aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorVojta Jina2010-11-05 22:37:55 +0000
committerIgor Minar2010-11-05 21:39:00 -0700
commitfe8353bc5e1cf8712655e8bb959165ee660bce26 (patch)
treec4fa6f0d64ab31eebe07604a7d62def33f6a807d /test
parentc780030c6e0b75de17b43ce56e7868f50984ac1d (diff)
downloadangular.js-fe8353bc5e1cf8712655e8bb959165ee660bce26.tar.bz2
Changed toJson() to not ignore $ properties
Diffstat (limited to 'test')
-rw-r--r--test/JsonSpec.js19
1 files changed, 6 insertions, 13 deletions
diff --git a/test/JsonSpec.js b/test/JsonSpec.js
index db658517..33aae6ff 100644
--- a/test/JsonSpec.js
+++ b/test/JsonSpec.js
@@ -49,10 +49,6 @@ describe('json', function(){
expect(fromJson("false")).toBeFalsy();
});
- it('should ignore $$ properties', function() {
- expect(toJson({$$:0})).toEqual("{}");
- });
-
it('should serialize array with empty items', function() {
var a = [];
a[1] = "X";
@@ -77,18 +73,15 @@ describe('json', function(){
expect(angular.toJson(obj)).toEqual('{"a":"b","recursion":RECURSION}');
});
- it('should ignore $ properties', function() {
- var scope = createScope();
- scope.a = 'a';
- scope['$b'] = '$b';
- scope.c = 'c';
- expect(angular.toJson(scope)).toEqual('{"a":"a","c":"c","this":RECURSION}');
+ it('should serialize $ properties', function() {
+ var obj = {$a: 'a'}
+ expect(angular.toJson(obj)).toEqual('{"$a":"a"}');
});
it('should serialize inherited properties', function() {
- var scope = createScope({p:'p'});
- scope.a = 'a';
- expect(angular.toJson(scope)).toEqual('{"a":"a","p":"p","this":RECURSION}');
+ var obj = inherit({p:'p'});
+ obj.a = 'a';
+ expect(angular.toJson(obj)).toEqual('{"a":"a","p":"p"}');
});
it('should serialize same objects multiple times', function() {