@@ -378,9 +378,12 @@ describe('Requests:', function() {
378
378
. and . calledWith ( 'requestTwo' , 'argTwo' ) ;
379
379
} ) ;
380
380
381
- it ( 'should return an array of replies' , function ( ) {
381
+ it ( 'should return an object of replies' , function ( ) {
382
382
expect ( this . Requests . request )
383
- . to . have . returned ( [ 'replyOne' , 'replyTwo' ] ) ;
383
+ . to . have . returned ( {
384
+ requestOne : 'replyOne' ,
385
+ requestTwo : 'replyTwo'
386
+ } ) ;
384
387
} ) ;
385
388
} ) ;
386
389
@@ -468,9 +471,12 @@ describe('Requests:', function() {
468
471
. and . calledWith ( 'requestTwo' , 'argOne' , 'argTwo' ) ;
469
472
} ) ;
470
473
471
- it ( 'should return an array of replies' , function ( ) {
474
+ it ( 'should return an object of replies' , function ( ) {
472
475
expect ( this . Requests . request )
473
- . to . have . returned ( [ 'replyOne' , 'replyTwo' ] ) ;
476
+ . to . have . returned ( {
477
+ requestOne : 'replyOne' ,
478
+ requestTwo : 'replyTwo'
479
+ } ) ;
474
480
} ) ;
475
481
} ) ;
476
482
@@ -532,9 +538,39 @@ describe('Requests:', function() {
532
538
. and . calledWith ( 'requestThree' , 'argTwo' ) ;
533
539
} ) ;
534
540
535
- it ( 'should return an array of replies' , function ( ) {
541
+ it ( 'should return an object of replies' , function ( ) {
536
542
expect ( this . Requests . request )
537
- . to . have . returned ( [ 'replyOne' , 'replyTwo' , 'replyThree' ] ) ;
543
+ . to . have . returned ( {
544
+ requestOne : 'replyOne' ,
545
+ requestTwo : 'replyTwo' ,
546
+ requestThree : 'replyThree'
547
+ } ) ;
548
+ } ) ;
549
+ } ) ;
550
+
551
+ describe ( 'when calling `request` with object with space-separated keys of requests with matching with matching keys' , function ( ) {
552
+ beforeEach ( function ( ) {
553
+ this . Requests . reply ( 'requestOne requestTwo' , _ . identity ) ;
554
+ this . Requests . request ( {
555
+ 'requestOne requestTwo' : 'argOne' ,
556
+ 'requestTwo' : 'argTwo'
557
+ } ) ;
558
+ } ) ;
559
+
560
+ it ( 'should call the set of requests' , function ( ) {
561
+ expect ( this . Requests . request )
562
+ . to . have . callCount ( 5 )
563
+ . and . calledWith ( 'requestOne' , 'argOne' )
564
+ . and . calledWith ( 'requestTwo' , 'argOne' )
565
+ . and . calledWith ( 'requestTwo' , 'argTwo' ) ;
566
+ } ) ;
567
+
568
+ it ( 'should return an object of replies override duplicate keys' , function ( ) {
569
+ expect ( this . Requests . request )
570
+ . to . have . returned ( {
571
+ requestOne : 'argOne' ,
572
+ requestTwo : 'argTwo'
573
+ } ) ;
538
574
} ) ;
539
575
} ) ;
540
576
} ) ;
0 commit comments