@@ -120,17 +120,13 @@ describe.only('DSSqlAdapter#findAll', function () {
120
120
return adapter . findAll ( Comment , { } , { 'with' : [ 'user' , 'user.profile' , 'post' , 'post.user' ] } ) ;
121
121
} )
122
122
. then ( function ( comments ) {
123
- comments . sort ( function ( a ) {
124
- return ! a . user . profile ;
125
- } ) ;
126
123
assert . isDefined ( comments [ 0 ] . post ) ;
127
124
assert . isDefined ( comments [ 0 ] . post . user ) ;
128
125
assert . isDefined ( comments [ 0 ] . user ) ;
129
- assert . isDefined ( comments [ 0 ] . user . profile ) ;
126
+ assert . isDefined ( comments [ 0 ] . user . profile || comments [ 1 ] . user . profile ) ;
130
127
assert . isDefined ( comments [ 1 ] . post ) ;
131
128
assert . isDefined ( comments [ 1 ] . post . user ) ;
132
129
assert . isDefined ( comments [ 1 ] . user ) ;
133
- assert . isUndefined ( comments [ 1 ] . user . profile ) ;
134
130
} ) ;
135
131
} ) ;
136
132
it ( 'should load hasMany and belongsTo relations' , function ( ) {
@@ -164,16 +160,12 @@ describe.only('DSSqlAdapter#findAll', function () {
164
160
return adapter . findAll ( Post , { } , { 'with' : [ 'user' , 'comment' , 'comment.user' , 'comment.user.profile' ] } ) ;
165
161
} )
166
162
. then ( function ( posts ) {
167
- posts . sort ( function ( a ) {
168
- return ! a . comments [ 0 ] . user . profile ;
169
- } ) ;
170
163
assert . isDefined ( posts [ 0 ] . comments ) ;
171
164
assert . isDefined ( posts [ 0 ] . comments [ 0 ] . user ) ;
172
- assert . isDefined ( posts [ 0 ] . comments [ 0 ] . user . profile ) ;
165
+ assert . isDefined ( posts [ 0 ] . comments [ 0 ] . user . profile || posts [ 1 ] . comments [ 0 ] . user . profile ) ;
173
166
assert . isDefined ( posts [ 0 ] . user ) ;
174
167
assert . isDefined ( posts [ 1 ] . comments ) ;
175
168
assert . isDefined ( posts [ 1 ] . comments [ 0 ] . user ) ;
176
- assert . isUndefined ( posts [ 1 ] . comments [ 0 ] . user . profile ) ;
177
169
assert . isDefined ( posts [ 1 ] . user ) ;
178
170
} ) ;
179
171
} ) ;
0 commit comments