@@ -209,7 +209,7 @@ describe('DS.loadRelations(resourceName, instance(Id), relations[, options]): ',
209209
210210 $httpBackend . flush ( ) ;
211211 } ) ;
212- it ( 'should load relations from array of objects ' , function ( ) {
212+ it ( 'should load relations from array of integers ' , function ( ) {
213213 DS . inject ( 'user' , user10 ) ;
214214 DS . inject ( 'user' , user16 ) ;
215215
@@ -223,6 +223,22 @@ describe('DS.loadRelations(resourceName, instance(Id), relations[, options]): ',
223223 assert . equal ( users [ 1 ] . organization . id , organization15 . id ) ;
224224 } , fail ) ;
225225
226+ $httpBackend . flush ( ) ;
227+ } ) ;
228+ it ( 'should load relations from collection' , function ( ) {
229+ DS . inject ( 'user' , user10 ) ;
230+ DS . inject ( 'user' , user16 ) ;
231+
232+ $httpBackend . expectGET ( 'http://test.angular-cache.com/organization/14' ) . respond ( 200 , organization14 ) ;
233+ $httpBackend . expectGET ( 'http://test.angular-cache.com/organization/15' ) . respond ( 200 , organization15 ) ;
234+
235+ DS . loadRelations ( 'user' , [ user10 , user16 ] , [ 'organization' ] ) . then ( function ( users ) {
236+ assert . isObject ( users [ 0 ] . organization ) ;
237+ assert . equal ( users [ 0 ] . organization . id , organization14 . id ) ;
238+ assert . isObject ( users [ 1 ] . organization ) ;
239+ assert . equal ( users [ 1 ] . organization . id , organization15 . id ) ;
240+ } , fail ) ;
241+
226242 $httpBackend . flush ( ) ;
227243 } ) ;
228244} ) ;
0 commit comments