aboutsummaryrefslogtreecommitdiffstats
path: root/test/AngularSpec.js
diff options
context:
space:
mode:
authorMisko Hevery2010-10-18 21:20:47 -0700
committerMisko Hevery2010-10-26 13:41:07 -0700
commit4fdab3765919e9fffc6d2f84e74754b1012997be (patch)
treed20dae529b35b0474912fea7765c5ca016a1c015 /test/AngularSpec.js
parent841013a4c4d25acf6fc9ff40e449c3d0a4b82ec3 (diff)
downloadangular.js-4fdab3765919e9fffc6d2f84e74754b1012997be.tar.bz2
create HTML sanitizer to allow inclusion of untrusted HTML in safe manner.
Sanitization works in two phases: 1) We parse the HTML into sax-like events (start, end, chars). HTML parsing is very complex, and so it may very well be that what most browser consider valid HTML may not pares properly here, but we do best effort. We treat this parser as untrusted. 2) We have safe sanitizeWriter which treats its input (start, end, chars) as untrusted content and escapes everything. It only allows elements in the whitelist and only allows attributes which are whitelisted. Any attribute value must not start with 'javascript:'. This check is performed after escaping for entity (&xAB; etc..) and ignoring any whitespace. - Correct linky filter to use safeHtmlWriter - Correct html filter to use safeHtmlWriter Close #33; Close #34
Diffstat (limited to 'test/AngularSpec.js')
-rw-r--r--test/AngularSpec.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/AngularSpec.js b/test/AngularSpec.js
index 8c7249d9..b60b7bd8 100644
--- a/test/AngularSpec.js
+++ b/test/AngularSpec.js
@@ -13,6 +13,15 @@ describe('Angular', function(){
});
});
+describe('case', function(){
+ it('should change case', function(){
+ expect(lowercase('ABC90')).toEqual('abc90');
+ expect(manualLowercase('ABC90')).toEqual('abc90');
+ expect(uppercase('abc90')).toEqual('ABC90');
+ expect(manualUppercase('abc90')).toEqual('ABC90');
+ });
+});
+
describe("copy", function(){
it("should return same object", function (){
var obj = {};
@@ -115,7 +124,7 @@ describe('toKeyValue', function() {
toEqual('escaped%20key=escaped%20value');
expect(toKeyValue({emptyKey: ''})).toEqual('emptyKey=');
});
-
+
it('should parse true values into flags', function() {
expect(toKeyValue({flag1: true, key: 'value', flag2: true})).toEqual('flag1&key=value&flag2');
});