@@ -87,25 +87,33 @@ describe('OAuth', function () {
8787 done ( ) ;
8888 }
8989
90- it ( 'Should fail a GET request' , done => {
90+ it ( 'GET request for a resource that requires OAuth should fail with invalid credentials' , done => {
91+ /*
92+ This endpoint has been chosen to make a request to an endpoint that requires OAuth which fails due to missing authentication.
93+ Any other endpoint from the Twitter API that requires OAuth can be used instead in case the currently used endpoint deprecates.
94+ */
9195 const options = {
9296 host : 'api.twitter.com' ,
93- consumer_key : 'XXXXXXXXXXXXXXXXXXXXXXXXX ' ,
94- consumer_secret : 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ' ,
97+ consumer_key : 'invalid_consumer_key ' ,
98+ consumer_secret : 'invalid_consumer_secret ' ,
9599 } ;
96- const path = '/1.1/help/configuration .json' ;
100+ const path = '/1.1/account/settings .json' ;
97101 const params = { lang : 'en' } ;
98102 const oauthClient = new OAuth ( options ) ;
99103 oauthClient . get ( path , params ) . then ( function ( data ) {
100104 validateCannotAuthenticateError ( data , done ) ;
101105 } ) ;
102106 } ) ;
103107
104- it ( 'Should fail a POST request' , done => {
108+ it ( 'POST request for a resource that requires OAuth should fail with invalid credentials' , done => {
109+ /*
110+ This endpoint has been chosen to make a request to an endpoint that requires OAuth which fails due to missing authentication.
111+ Any other endpoint from the Twitter API that requires OAuth can be used instead in case the currently used endpoint deprecates.
112+ */
105113 const options = {
106114 host : 'api.twitter.com' ,
107- consumer_key : 'XXXXXXXXXXXXXXXXXXXXXXXXX ' ,
108- consumer_secret : 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ' ,
115+ consumer_key : 'invalid_consumer_key ' ,
116+ consumer_secret : 'invalid_consumer_secret ' ,
109117 } ;
110118 const body = {
111119 lang : 'en' ,
0 commit comments