@@ -2636,15 +2636,15 @@ describe('ParticleAPI', () => {
26362636 contextResult = { def : 456 } ;
26372637 result = 'fake-result' ;
26382638 api . _buildContext = sinon . stub ( ) . returns ( contextResult ) ;
2639- api . _getEffectiveAuth = sinon . stub ( ) . returns ( auth ) ;
2639+ api . _getActiveAuthToken = sinon . stub ( ) . returns ( auth ) ;
26402640 } ) ;
26412641
26422642 afterEach ( ( ) => {
26432643 expect ( api . _buildContext ) . to . have . been . calledWith ( context ) ;
2644- expect ( api . _getEffectiveAuth ) . to . have . been . calledWith ( auth ) ;
2644+ expect ( api . _getActiveAuthToken ) . to . have . been . calledWith ( auth ) ;
26452645 } ) ;
26462646
2647- it ( 'calls _buildContext and _getEffectiveAuth from get' , ( ) => {
2647+ it ( 'calls _buildContext and _getActiveAuthToken from get' , ( ) => {
26482648 api . agent . get = sinon . stub ( ) . returns ( result ) ;
26492649 const options = { uri, auth, headers, query, context } ;
26502650 const res = api . get ( options ) ;
@@ -2658,7 +2658,7 @@ describe('ParticleAPI', () => {
26582658 } ) ;
26592659 } ) ;
26602660
2661- it ( 'calls _buildContext and _getEffectiveAuth from head' , ( ) => {
2661+ it ( 'calls _buildContext and _getActiveAuthToken from head' , ( ) => {
26622662 api . agent . head = sinon . stub ( ) . returns ( result ) ;
26632663 const options = { uri, auth, headers, query, context } ;
26642664 const res = api . head ( options ) ;
@@ -2672,7 +2672,7 @@ describe('ParticleAPI', () => {
26722672 } ) ;
26732673 } ) ;
26742674
2675- it ( 'calls _buildContext and _getEffectiveAuth from post' , ( ) => {
2675+ it ( 'calls _buildContext and _getActiveAuthToken from post' , ( ) => {
26762676 api . agent . post = sinon . stub ( ) . returns ( result ) ;
26772677 const options = { uri, auth, headers, data, context } ;
26782678 const res = api . post ( options ) ;
@@ -2686,7 +2686,7 @@ describe('ParticleAPI', () => {
26862686 } ) ;
26872687 } ) ;
26882688
2689- it ( 'calls _buildContext and _getEffectiveAuth from put' , ( ) => {
2689+ it ( 'calls _buildContext and _getActiveAuthToken from put' , ( ) => {
26902690 api . agent . put = sinon . stub ( ) . returns ( result ) ;
26912691 const options = { uri, auth, headers, data, context } ;
26922692 const res = api . put ( options ) ;
@@ -2700,7 +2700,7 @@ describe('ParticleAPI', () => {
27002700 } ) ;
27012701 } ) ;
27022702
2703- it ( 'calls _buildContext and _getEffectiveAuth from delete' , ( ) => {
2703+ it ( 'calls _buildContext and _getActiveAuthToken from delete' , ( ) => {
27042704 api . agent . delete = sinon . stub ( ) . returns ( result ) ;
27052705 const options = { uri, auth, headers, data, context } ;
27062706 const res = api . delete ( options ) ;
@@ -2714,7 +2714,7 @@ describe('ParticleAPI', () => {
27142714 } ) ;
27152715 } ) ;
27162716
2717- it ( 'calls _buildContext and _getEffectiveAuth from request' , ( ) => {
2717+ it ( 'calls _buildContext and _getActiveAuthToken from request' , ( ) => {
27182718 api . agent . request = sinon . stub ( ) . returns ( result ) ;
27192719 api . request ( { context, auth } ) . should . eql ( result ) ;
27202720 expect ( api . agent . request ) . to . have . been . calledWith ( { context :contextResult , auth } ) ;
@@ -2749,28 +2749,28 @@ describe('ParticleAPI', () => {
27492749 } ) ;
27502750 } ) ;
27512751
2752- describe ( '_getEffectiveAuth (auth)' , ( ) => {
2752+ describe ( '_getActiveAuthToken (auth)' , ( ) => {
27532753 afterEach ( ( ) => {
27542754 sinon . restore ( ) ;
27552755 } ) ;
27562756
27572757 it ( 'returns provided value when provided value is truthy' , ( ) => {
27582758 const expectedReturnValue = 'pass through' ;
2759- expect ( api . _getEffectiveAuth ( expectedReturnValue ) ) . to . eql ( expectedReturnValue ) ;
2759+ expect ( api . _getActiveAuthToken ( expectedReturnValue ) ) . to . eql ( expectedReturnValue ) ;
27602760 } ) ;
27612761
27622762 it ( 'returns value of _defaultAuth when provided value is NOT truthy' , ( ) => {
27632763 const providedValue = undefined ;
27642764 const expectedReturnValue = 'default auth value' ;
27652765 api . setDefaultAuth ( expectedReturnValue ) ;
2766- expect ( api . _getEffectiveAuth ( providedValue ) ) . to . eql ( expectedReturnValue ) ;
2766+ expect ( api . _getActiveAuthToken ( providedValue ) ) . to . eql ( expectedReturnValue ) ;
27672767 } ) ;
27682768
27692769 it ( 'returns undefined when both provided value and _defaultAuth are NOT truthy' , ( ) => {
27702770 const providedValue = undefined ;
27712771 const expectedReturnValue = undefined ;
27722772 api . setDefaultAuth ( undefined ) ;
2773- expect ( api . _getEffectiveAuth ( providedValue ) ) . to . eql ( expectedReturnValue ) ;
2773+ expect ( api . _getActiveAuthToken ( providedValue ) ) . to . eql ( expectedReturnValue ) ;
27742774 } ) ;
27752775 } ) ;
27762776} ) ;
0 commit comments