diff options
| author | Misko Hevery | 2010-01-23 15:54:58 -0800 |
|---|---|---|
| committer | Misko Hevery | 2010-01-23 15:54:58 -0800 |
| commit | 4460328bc1173f5d97fb4ff54edc041968486fce (patch) | |
| tree | 40e18a175f7f1ae104aa56347fe5038526374ed8 /test/JsonTest.js | |
| parent | e41ee88ef85986dcd0fea23fefcc57d89cee5c0b (diff) | |
| download | angular.js-4460328bc1173f5d97fb4ff54edc041968486fce.tar.bz2 | |
lots of cleanup to get it ready for OS
Diffstat (limited to 'test/JsonTest.js')
| -rw-r--r-- | test/JsonTest.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/JsonTest.js b/test/JsonTest.js index cf49bec3..9b275248 100644 --- a/test/JsonTest.js +++ b/test/JsonTest.js @@ -67,3 +67,14 @@ JsonTest.prototype.testItShouldUTCDates = function() { assertEquals(date.getTime(), fromJson('"2009-10-09T01:02:03Z"').getTime()); }; + +JsonTest.prototype.testItShouldPreventRecursion = function () { + var obj = {a:'b'}; + obj.recursion = obj; + assertEquals('{"a":"b","recursion":RECURSION}', angular.toJson(obj)); +}; + +JsonTest.prototype.testItShouldSerializeSameObjectsMultipleTimes = function () { + var obj = {a:'b'}; + assertEquals('{"A":{"a":"b"},"B":{"a":"b"}}', angular.toJson({A:obj, B:obj})); +}; |
