@@ -339,11 +339,11 @@ describe('Installations', () => {
339
339
. then ( ( ) => database . adapter . find ( '_Installation' , installationSchema , { } , { } ) )
340
340
. then ( results => {
341
341
expect ( results . length ) . toEqual ( 1 ) ;
342
- var id = results [ 0 ] . objectId ;
342
+ var objectId = results [ 0 ] . objectId ;
343
343
var update = {
344
344
'channels' : [ 'baz' ]
345
345
} ;
346
- return rest . update ( config , auth . nobody ( config ) , '_Installation' , id , update ) ;
346
+ return rest . update ( config , auth . nobody ( config ) , '_Installation' , { objectId } , update ) ;
347
347
} )
348
348
. then ( ( ) => database . adapter . find ( '_Installation' , installationSchema , { } , { } ) )
349
349
. then ( results => {
@@ -370,7 +370,7 @@ describe('Installations', () => {
370
370
. then ( results => {
371
371
expect ( results . length ) . toEqual ( 1 ) ;
372
372
input = { 'installationId' : installId2 } ;
373
- return rest . update ( config , auth . nobody ( config ) , '_Installation' , results [ 0 ] . objectId , input ) ;
373
+ return rest . update ( config , auth . nobody ( config ) , '_Installation' , { objectId : results [ 0 ] . objectId } , input ) ;
374
374
} ) . then ( ( ) => {
375
375
fail ( 'Updating the installation should have failed.' ) ;
376
376
done ( ) ;
@@ -393,7 +393,7 @@ describe('Installations', () => {
393
393
. then ( results => {
394
394
expect ( results . length ) . toEqual ( 1 ) ;
395
395
input = { 'deviceToken' : b } ;
396
- return rest . update ( config , auth . nobody ( config ) , '_Installation' , results [ 0 ] . objectId , input ) ;
396
+ return rest . update ( config , auth . nobody ( config ) , '_Installation' , { objectId : results [ 0 ] . objectId } , input ) ;
397
397
} ) . then ( ( ) => {
398
398
fail ( 'Updating the installation should have failed.' ) ;
399
399
} ) . catch ( ( error ) => {
@@ -421,7 +421,7 @@ describe('Installations', () => {
421
421
'deviceToken' : u ,
422
422
'deviceType' : 'ios'
423
423
} ;
424
- return rest . update ( config , auth . nobody ( config ) , '_Installation' , results [ 0 ] . objectId , input ) ;
424
+ return rest . update ( config , auth . nobody ( config ) , '_Installation' , { objectId : results [ 0 ] . objectId } , input ) ;
425
425
} )
426
426
. then ( ( ) => database . adapter . find ( '_Installation' , installationSchema , { } , { } ) )
427
427
. then ( results => {
@@ -448,7 +448,7 @@ describe('Installations', () => {
448
448
input = {
449
449
'deviceType' : 'ios'
450
450
} ;
451
- return rest . update ( config , auth . nobody ( config ) , '_Installation' , results [ 0 ] . objectId , input ) ;
451
+ return rest . update ( config , auth . nobody ( config ) , '_Installation' , { objectId : results [ 0 ] . objectId } , input ) ;
452
452
} ) . then ( ( ) => {
453
453
fail ( 'Should not have been able to update Installation.' ) ;
454
454
done ( ) ;
@@ -472,7 +472,7 @@ describe('Installations', () => {
472
472
input = {
473
473
'custom' : 'allowed'
474
474
} ;
475
- return rest . update ( config , auth . nobody ( config ) , '_Installation' , results [ 0 ] . objectId , input ) ;
475
+ return rest . update ( config , auth . nobody ( config ) , '_Installation' , { objectId : results [ 0 ] . objectId } , input ) ;
476
476
} )
477
477
. then ( ( ) => database . adapter . find ( '_Installation' , installationSchema , { } , { } ) )
478
478
. then ( results => {
@@ -514,7 +514,7 @@ describe('Installations', () => {
514
514
'objectId' : secondObject . objectId ,
515
515
'deviceToken' : t
516
516
} ;
517
- return rest . update ( config , auth . nobody ( config ) , '_Installation' , secondObject . objectId , input ) ;
517
+ return rest . update ( config , auth . nobody ( config ) , '_Installation' , { objectId : secondObject . objectId } , input ) ;
518
518
} )
519
519
. then ( ( ) => database . adapter . find ( '_Installation' , installationSchema , { objectId : firstObject . objectId } , { } ) )
520
520
. then ( results => {
@@ -562,7 +562,7 @@ describe('Installations', () => {
562
562
'installationId' : installId2 ,
563
563
'deviceToken' : t
564
564
} ;
565
- return rest . update ( config , auth . nobody ( config ) , '_Installation' , secondObject . objectId , input ) ;
565
+ return rest . update ( config , auth . nobody ( config ) , '_Installation' , { objectId : secondObject . objectId } , input ) ;
566
566
} )
567
567
. then ( ( ) => delay ( 100 ) )
568
568
. then ( ( ) => database . adapter . find ( '_Installation' , installationSchema , { objectId : firstObject . objectId } , { } ) )
@@ -619,7 +619,7 @@ describe('Installations', () => {
619
619
'deviceToken' : t ,
620
620
'channels' : [ ]
621
621
} ;
622
- return rest . update ( config , auth . nobody ( config ) , '_Installation' , results [ 0 ] . objectId , input ) ;
622
+ return rest . update ( config , auth . nobody ( config ) , '_Installation' , { objectId : results [ 0 ] . objectId } , input ) ;
623
623
} )
624
624
. then ( ( ) => database . adapter . find ( '_Installation' , installationSchema , { } , { } ) )
625
625
. then ( results => {
@@ -657,7 +657,7 @@ describe('Installations', () => {
657
657
'installationId' : installId ,
658
658
'deviceType' : 'ios'
659
659
} ;
660
- return rest . update ( config , auth . nobody ( config ) , '_Installation' , results [ 0 ] . objectId , input ) ;
660
+ return rest . update ( config , auth . nobody ( config ) , '_Installation' , { objectId : results [ 0 ] . objectId } , input ) ;
661
661
} )
662
662
. then ( ( ) => database . adapter . find ( '_Installation' , installationSchema , { } , { } ) )
663
663
. then ( results => {
@@ -699,7 +699,7 @@ describe('Installations', () => {
699
699
'amount' : 1
700
700
}
701
701
} ;
702
- return rest . update ( config , auth . nobody ( config ) , '_Installation' , results [ 0 ] . objectId , input ) ;
702
+ return rest . update ( config , auth . nobody ( config ) , '_Installation' , { objectId : results [ 0 ] . objectId } , input ) ;
703
703
} )
704
704
. then ( ( ) => database . adapter . find ( '_Installation' , installationSchema , { } , { } ) )
705
705
. then ( results => {
@@ -744,7 +744,7 @@ describe('Installations', () => {
744
744
'deviceToken' : t ,
745
745
'deviceType' : 'ios'
746
746
} ;
747
- return rest . update ( config , auth . nobody ( config ) , '_Installation' , installObj . objectId , input ) ;
747
+ return rest . update ( config , auth . nobody ( config ) , '_Installation' , { objectId : installObj . objectId } , input ) ;
748
748
} )
749
749
. then ( ( ) => database . adapter . find ( '_Installation' , installationSchema , { objectId : tokenObj . objectId } , { } ) )
750
750
. then ( results => {
@@ -791,7 +791,7 @@ describe('Installations', () => {
791
791
'amount' : 1
792
792
}
793
793
} ;
794
- return rest . update ( config , auth . nobody ( config ) , '_Installation' , installObj . objectId , input ) ;
794
+ return rest . update ( config , auth . nobody ( config ) , '_Installation' , { objectId : installObj . objectId } , input ) ;
795
795
} )
796
796
. then ( ( ) => database . adapter . find ( '_Installation' , installationSchema , { objectId : tokenObj . objectId } , { } ) )
797
797
. then ( results => {
0 commit comments