@@ -37,7 +37,7 @@ describe('DS.find(resourceName, id[, options]): ', function () {
37
37
$httpBackend . expectGET ( 'http://test.angular-cache.com/posts/5' ) . respond ( 200 , p1 ) ;
38
38
39
39
DS . find ( 'post' , 5 ) . then ( function ( post ) {
40
- assert . deepEqual ( post , p1 ) ;
40
+ assert . deepEqual ( angular . toJson ( post ) , angular . toJson ( p1 ) ) ;
41
41
} , function ( err ) {
42
42
console . error ( err . stack ) ;
43
43
fail ( 'Should not have rejected!' ) ;
@@ -47,21 +47,21 @@ describe('DS.find(resourceName, id[, options]): ', function () {
47
47
48
48
// Should have no effect because there is already a pending query
49
49
DS . find ( 'post' , 5 ) . then ( function ( post ) {
50
- assert . deepEqual ( post , p1 ) ;
50
+ assert . deepEqual ( angular . toJson ( post ) , angular . toJson ( p1 ) ) ;
51
51
} , function ( err ) {
52
52
console . error ( err . stack ) ;
53
53
fail ( 'Should not have rejected!' ) ;
54
54
} ) ;
55
55
56
56
$httpBackend . flush ( ) ;
57
57
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' ) ;
59
59
assert . isNumber ( DS . lastModified ( 'post' , 5 ) ) ;
60
60
assert . isNumber ( DS . lastSaved ( 'post' , 5 ) ) ;
61
61
62
62
// Should not make a request because the request was already completed
63
63
DS . find ( 'post' , 5 ) . then ( function ( post ) {
64
- assert . deepEqual ( post , p1 ) ;
64
+ assert . deepEqual ( angular . toJson ( post ) , angular . toJson ( p1 ) ) ;
65
65
} , function ( err ) {
66
66
console . error ( err . stack ) ;
67
67
fail ( 'Should not have rejected!' ) ;
@@ -71,7 +71,7 @@ describe('DS.find(resourceName, id[, options]): ', function () {
71
71
72
72
// Should make a request because bypassCache is set to true
73
73
DS . find ( 'post' , 5 , { bypassCache : true } ) . then ( function ( post ) {
74
- assert . deepEqual ( post , p1 ) ;
74
+ assert . deepEqual ( angular . toJson ( post ) , angular . toJson ( p1 ) ) ;
75
75
} , function ( err ) {
76
76
console . error ( err . stack ) ;
77
77
fail ( 'Should not have rejected!' ) ;
@@ -88,7 +88,7 @@ describe('DS.find(resourceName, id[, options]): ', function () {
88
88
$httpBackend . expectGET ( 'http://test.angular-cache.com/posts/5' ) . respond ( 200 , p1 ) ;
89
89
90
90
DS . find ( 'post' , 5 , { cacheResponse : false } ) . then ( function ( post ) {
91
- assert . deepEqual ( post , p1 ) ;
91
+ assert . deepEqual ( angular . toJson ( post ) , angular . toJson ( p1 ) ) ;
92
92
} , function ( err ) {
93
93
console . error ( err . stack ) ;
94
94
fail ( 'Should not have rejected!' ) ;
@@ -126,8 +126,8 @@ describe('DS.find(resourceName, id[, options]): ', function () {
126
126
approvedBy : 4
127
127
}
128
128
} ) . 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 ) ) ) ;
131
131
} , function ( ) {
132
132
fail ( 'Should not have failed!' ) ;
133
133
} ) ;
@@ -139,8 +139,8 @@ describe('DS.find(resourceName, id[, options]): ', function () {
139
139
DS . find ( 'comment' , 5 , {
140
140
bypassCache : true
141
141
} ) . 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 ) ) ) ;
144
144
} , function ( ) {
145
145
fail ( 'Should not have failed!' ) ;
146
146
} ) ;
@@ -155,8 +155,8 @@ describe('DS.find(resourceName, id[, options]): ', function () {
155
155
approvedBy : false
156
156
}
157
157
} ) . 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 ) ) ) ;
160
160
} , function ( ) {
161
161
fail ( 'Should not have failed!' ) ;
162
162
} ) ;
@@ -172,8 +172,8 @@ describe('DS.find(resourceName, id[, options]): ', function () {
172
172
organizationId : 14
173
173
}
174
174
} ) . 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 ) ) ) ;
177
177
} , function ( ) {
178
178
fail ( 'Should not have failed!' ) ;
179
179
} ) ;
0 commit comments