@@ -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 integers' , function ( ) {
212+ it ( 'should load belongsto relations from array of integers' , function ( ) {
213213 DS . inject ( 'user' , user10 ) ;
214214 DS . inject ( 'user' , user16 ) ;
215215
@@ -225,7 +225,7 @@ describe('DS.loadRelations(resourceName, instance(Id), relations[, options]): ',
225225
226226 $httpBackend . flush ( ) ;
227227 } ) ;
228- it ( 'should load relations from collection' , function ( ) {
228+ it ( 'should load belongsto relations from collection' , function ( ) {
229229 DS . inject ( 'user' , user10 ) ;
230230 DS . inject ( 'user' , user16 ) ;
231231
@@ -239,6 +239,23 @@ describe('DS.loadRelations(resourceName, instance(Id), relations[, options]): ',
239239 assert . equal ( users [ 1 ] . organization . id , organization15 . id ) ;
240240 } , fail ) ;
241241
242+ $httpBackend . flush ( ) ;
243+ } ) ;
244+ it ( 'should load hasmany relations from collection' , function ( ) {
245+
246+ DS . inject ( 'organization' , organization14 ) ;
247+ DS . inject ( 'organization' , organization15 ) ;
248+
249+ $httpBackend . expectGET ( 'http://test.angular-cache.com/organization/14/user' ) . respond ( 200 , [ user10 ] ) ;
250+ $httpBackend . expectGET ( 'http://test.angular-cache.com/organization/15/user' ) . respond ( 200 , [ user16 ] ) ;
251+
252+ DS . loadRelations ( 'organization' , [ organization14 , organization15 ] , [ 'user' ] ) . then ( function ( organizations ) {
253+ assert . isObject ( organization14 . users [ 0 ] ) ;
254+ assert . equal ( organization14 . users [ 0 ] . id , 10 ) ;
255+ assert . isObject ( organization15 . users [ 0 ] ) ;
256+ assert . equal ( organization15 . users [ 0 ] . id , 16 ) ;
257+ } ) ;
258+
242259 $httpBackend . flush ( ) ;
243260 } ) ;
244261} ) ;
0 commit comments