@@ -37,7 +37,7 @@ describe('DS.find(resourceName, id[, options]): ', function () {
3737 $httpBackend . expectGET ( 'http://test.angular-cache.com/posts/5' ) . respond ( 200 , p1 ) ;
3838
3939 DS . find ( 'post' , 5 ) . then ( function ( post ) {
40- assert . deepEqual ( post , p1 ) ;
40+ assert . deepEqual ( angular . toJson ( post ) , angular . toJson ( p1 ) ) ;
4141 } , function ( err ) {
4242 console . error ( err . stack ) ;
4343 fail ( 'Should not have rejected!' ) ;
@@ -47,21 +47,21 @@ describe('DS.find(resourceName, id[, options]): ', function () {
4747
4848 // Should have no effect because there is already a pending query
4949 DS . find ( 'post' , 5 ) . then ( function ( post ) {
50- assert . deepEqual ( post , p1 ) ;
50+ assert . deepEqual ( angular . toJson ( post ) , angular . toJson ( p1 ) ) ;
5151 } , function ( err ) {
5252 console . error ( err . stack ) ;
5353 fail ( 'Should not have rejected!' ) ;
5454 } ) ;
5555
5656 $httpBackend . flush ( ) ;
5757
58- assert . deepEqual ( DS . get ( 'post' , 5 ) , p1 , 'The post is now in the store' ) ;
58+ assert . deepEqual ( angular . toJson ( DS . get ( 'post' , 5 ) ) , angular . toJson ( p1 ) , 'The post is now in the store' ) ;
5959 assert . isNumber ( DS . lastModified ( 'post' , 5 ) ) ;
6060 assert . isNumber ( DS . lastSaved ( 'post' , 5 ) ) ;
6161
6262 // Should not make a request because the request was already completed
6363 DS . find ( 'post' , 5 ) . then ( function ( post ) {
64- assert . deepEqual ( post , p1 ) ;
64+ assert . deepEqual ( angular . toJson ( post ) , angular . toJson ( p1 ) ) ;
6565 } , function ( err ) {
6666 console . error ( err . stack ) ;
6767 fail ( 'Should not have rejected!' ) ;
@@ -71,7 +71,7 @@ describe('DS.find(resourceName, id[, options]): ', function () {
7171
7272 // Should make a request because bypassCache is set to true
7373 DS . find ( 'post' , 5 , { bypassCache : true } ) . then ( function ( post ) {
74- assert . deepEqual ( post , p1 ) ;
74+ assert . deepEqual ( angular . toJson ( post ) , angular . toJson ( p1 ) ) ;
7575 } , function ( err ) {
7676 console . error ( err . stack ) ;
7777 fail ( 'Should not have rejected!' ) ;
@@ -88,7 +88,7 @@ describe('DS.find(resourceName, id[, options]): ', function () {
8888 $httpBackend . expectGET ( 'http://test.angular-cache.com/posts/5' ) . respond ( 200 , p1 ) ;
8989
9090 DS . find ( 'post' , 5 , { cacheResponse : false } ) . then ( function ( post ) {
91- assert . deepEqual ( post , p1 ) ;
91+ assert . deepEqual ( angular . toJson ( post ) , angular . toJson ( p1 ) ) ;
9292 } , function ( err ) {
9393 console . error ( err . stack ) ;
9494 fail ( 'Should not have rejected!' ) ;
@@ -126,8 +126,8 @@ describe('DS.find(resourceName, id[, options]): ', function () {
126126 approvedBy : 4
127127 }
128128 } ) . then ( function ( comment ) {
129- assert . deepEqual ( comment , testComment ) ;
130- assert . deepEqual ( comment , DS . get ( 'comment' , 5 ) ) ;
129+ assert . deepEqual ( angular . toJson ( comment ) , angular . toJson ( testComment ) ) ;
130+ assert . deepEqual ( angular . toJson ( comment ) , angular . toJson ( DS . get ( 'comment' , 5 ) ) ) ;
131131 } , function ( ) {
132132 fail ( 'Should not have failed!' ) ;
133133 } ) ;
@@ -139,8 +139,8 @@ describe('DS.find(resourceName, id[, options]): ', function () {
139139 DS . find ( 'comment' , 5 , {
140140 bypassCache : true
141141 } ) . then ( function ( comment ) {
142- assert . deepEqual ( comment , testComment ) ;
143- assert . deepEqual ( comment , DS . get ( 'comment' , 5 ) ) ;
142+ assert . deepEqual ( angular . toJson ( comment ) , angular . toJson ( testComment ) ) ;
143+ assert . deepEqual ( angular . toJson ( comment ) , angular . toJson ( DS . get ( 'comment' , 5 ) ) ) ;
144144 } , function ( ) {
145145 fail ( 'Should not have failed!' ) ;
146146 } ) ;
@@ -155,8 +155,8 @@ describe('DS.find(resourceName, id[, options]): ', function () {
155155 approvedBy : false
156156 }
157157 } ) . then ( function ( comment ) {
158- assert . deepEqual ( comment , testComment ) ;
159- assert . deepEqual ( comment , DS . get ( 'comment' , 5 ) ) ;
158+ assert . deepEqual ( angular . toJson ( comment ) , angular . toJson ( testComment ) ) ;
159+ assert . deepEqual ( angular . toJson ( comment ) , angular . toJson ( DS . get ( 'comment' , 5 ) ) ) ;
160160 } , function ( ) {
161161 fail ( 'Should not have failed!' ) ;
162162 } ) ;
@@ -172,8 +172,8 @@ describe('DS.find(resourceName, id[, options]): ', function () {
172172 organizationId : 14
173173 }
174174 } ) . then ( function ( comment ) {
175- assert . deepEqual ( comment , comment19 ) ;
176- assert . deepEqual ( comment , DS . get ( 'comment' , 19 ) ) ;
175+ assert . deepEqual ( angular . toJson ( comment ) , angular . toJson ( comment19 ) ) ;
176+ assert . deepEqual ( angular . toJson ( comment ) , angular . toJson ( DS . get ( 'comment' , 19 ) ) ) ;
177177 } , function ( ) {
178178 fail ( 'Should not have failed!' ) ;
179179 } ) ;
0 commit comments