@@ -150,8 +150,12 @@ describe('Products Resource', function() {
150150 } ;
151151
152152 before ( function ( ) {
153- nock ( 'https://api.uber.com' )
154- . get ( '/v1/products?server_token=SERVERTOKENSERVERTOKENSERVERTOKENSERVERT&latitude=3.1357&longitude=101.688' )
153+ nock ( 'https://api.uber.com' , {
154+ reqheaders : {
155+ 'Authorization' : 'Token SERVERTOKENSERVERTOKENSERVERTOKENSERVERT'
156+ }
157+ } )
158+ . get ( '/v1/products?latitude=3.1357&longitude=101.688' )
155159 . reply ( 200 , productReply ) ;
156160 } ) ;
157161
@@ -209,8 +213,12 @@ describe('Payment Resource', function() {
209213 . post ( '/oauth/token' )
210214 . times ( 3 )
211215 . reply ( 200 , tokenResponse ) ;
212- nock ( 'https://api.uber.com' )
213- . get ( '/v1/payment-methods?access_token=EE1IDxytP04tJ767GbjH7ED9PpGmYvL' )
216+ nock ( 'https://api.uber.com' , {
217+ reqheaders : {
218+ 'Authorization' : 'Bearer EE1IDxytP04tJ767GbjH7ED9PpGmYvL'
219+ }
220+ } )
221+ . get ( '/v1/payment-methods' )
214222 . reply ( 200 , paymentMethodsReply ) ;
215223 } ) ;
216224
@@ -265,8 +273,12 @@ describe('Places Resource', function() {
265273 . times ( 3 )
266274 . reply ( 200 , tokenResponse ) ;
267275
268- nock ( 'https://api.uber.com' )
269- . get ( '/v1/places/home?access_token=EE1IDxytP04tJ767GbjH7ED9PpGmYvL' )
276+ nock ( 'https://api.uber.com' , {
277+ reqheaders : {
278+ 'Authorization' : 'Bearer EE1IDxytP04tJ767GbjH7ED9PpGmYvL'
279+ }
280+ } )
281+ . get ( '/v1/places/home' )
270282 . reply ( 200 , placesHomeReply ) ;
271283 } ) ;
272284
@@ -307,8 +319,12 @@ describe('Places Resource', function() {
307319 . times ( 3 )
308320 . reply ( 200 , tokenResponse ) ;
309321
310- nock ( 'https://api.uber.com' )
311- . get ( '/v1/places/work?access_token=EE1IDxytP04tJ767GbjH7ED9PpGmYvL' )
322+ nock ( 'https://api.uber.com' , {
323+ reqheaders : {
324+ 'Authorization' : 'Bearer EE1IDxytP04tJ767GbjH7ED9PpGmYvL'
325+ }
326+ } )
327+ . get ( '/v1/places/work' )
312328 . reply ( 200 , placesWorkReply ) ;
313329 } ) ;
314330
@@ -401,9 +417,12 @@ describe('Estimates Resource', function() {
401417
402418 describe ( 'Price Estimates' , function ( ) {
403419 before ( function ( ) {
404- nock ( 'https://api.uber.com' )
405- . get ( '/v1/estimates/price?server_token=SERVERTOKENSERVERTOKENSERVERTOKENSERVERT&' +
406- 'start_latitude=3.1357&start_longitude=101.688&end_latitude=3.0833&end_longitude=101.65&seat_count=2' )
420+ nock ( 'https://api.uber.com' , {
421+ reqheaders : {
422+ 'Authorization' : 'Token SERVERTOKENSERVERTOKENSERVERTOKENSERVERT'
423+ }
424+ } )
425+ . get ( '/v1/estimates/price?start_latitude=3.1357&start_longitude=101.688&end_latitude=3.0833&end_longitude=101.65&seat_count=2' )
407426 . reply ( 200 , priceReply ) ;
408427 } ) ;
409428
@@ -430,9 +449,12 @@ describe('Estimates Resource', function() {
430449
431450 describe ( 'Time Estimates' , function ( ) {
432451 before ( function ( ) {
433- nock ( 'https://api.uber.com' )
434- . get ( '/v1/estimates/time?server_token=SERVERTOKENSERVERTOKENSERVERTOKENSERVERT&' +
435- 'start_latitude=3.1357&start_longitude=101.688' )
452+ nock ( 'https://api.uber.com' , {
453+ reqheaders : {
454+ 'Authorization' : 'Token SERVERTOKENSERVERTOKENSERVERTOKENSERVERT'
455+ }
456+ } )
457+ . get ( '/v1/estimates/time?start_latitude=3.1357&start_longitude=101.688' )
436458 . reply ( 200 , timeReply ) ;
437459 } ) ;
438460
@@ -497,8 +519,12 @@ describe('User Resource', function() {
497519 . post ( '/oauth/token' )
498520 . reply ( 200 , tokenResponse ) ;
499521
500- nock ( 'https://api.uber.com' )
501- . get ( '/v1/me?access_token=EE1IDxytP04tJ767GbjH7ED9PpGmYvL' )
522+ nock ( 'https://api.uber.com' , {
523+ reqheaders : {
524+ 'Authorization' : 'Bearer EE1IDxytP04tJ767GbjH7ED9PpGmYvL'
525+ }
526+ } )
527+ . get ( '/v1/me' )
502528 . times ( 2 )
503529 . reply ( 200 , profileReply ) ;
504530 } ) ;
@@ -533,9 +559,13 @@ describe('User Resource', function() {
533559 . times ( 3 )
534560 . reply ( 200 , tokenResponse ) ;
535561
536- nock ( 'https://api.uber.com' )
562+ nock ( 'https://api.uber.com' , {
563+ reqheaders : {
564+ 'Authorization' : 'Bearer EE1IDxytP04tJ767GbjH7ED9PpGmYvL'
565+ }
566+ } )
537567 . get ( function ( uri ) {
538- var parts = uri . split ( '/v1.2/history?access_token=EE1IDxytP04tJ767GbjH7ED9PpGmYvL& offset=0&limit=' ) ;
568+ var parts = uri . split ( '/v1.2/history?offset=0&limit=' ) ;
539569 if ( parts . length !== 2 ) {
540570 return false ;
541571 }
0 commit comments