@@ -87,25 +87,33 @@ describe('OAuth', function () {
87
87
done ( ) ;
88
88
}
89
89
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
+ */
91
95
const options = {
92
96
host : 'api.twitter.com' ,
93
- consumer_key : 'XXXXXXXXXXXXXXXXXXXXXXXXX ' ,
94
- consumer_secret : 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ' ,
97
+ consumer_key : 'invalid_consumer_key ' ,
98
+ consumer_secret : 'invalid_consumer_secret ' ,
95
99
} ;
96
- const path = '/1.1/help/configuration .json' ;
100
+ const path = '/1.1/account/settings .json' ;
97
101
const params = { lang : 'en' } ;
98
102
const oauthClient = new OAuth ( options ) ;
99
103
oauthClient . get ( path , params ) . then ( function ( data ) {
100
104
validateCannotAuthenticateError ( data , done ) ;
101
105
} ) ;
102
106
} ) ;
103
107
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
+ */
105
113
const options = {
106
114
host : 'api.twitter.com' ,
107
- consumer_key : 'XXXXXXXXXXXXXXXXXXXXXXXXX ' ,
108
- consumer_secret : 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ' ,
115
+ consumer_key : 'invalid_consumer_key ' ,
116
+ consumer_secret : 'invalid_consumer_secret ' ,
109
117
} ;
110
118
const body = {
111
119
lang : 'en' ,
0 commit comments