Skip to content

Commit b4482e6

Browse files
committedNov 29, 2017
test: oauth with other query params
1 parent 2ffd459 commit b4482e6

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
 

‎test/integration/authentication-test.js

+37
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,24 @@ describe('authentication', () => {
7070
return github.orgs.get({org: 'myorg'})
7171
})
7272

73+
it('oauth token with query', () => {
74+
nock('https://authentication-test-host.com')
75+
.get('/orgs/myorg/repos')
76+
.query({per_page: 1, access_token: 'abc4567'})
77+
.reply(200, [])
78+
79+
const github = new GitHub({
80+
host: 'authentication-test-host.com'
81+
})
82+
83+
github.authenticate({
84+
type: 'oauth',
85+
token: 'abc4567'
86+
})
87+
88+
return github.repos.getForOrg({org: 'myorg', per_page: 1})
89+
})
90+
7391
it('oauth key & secret', () => {
7492
nock('https://authentication-test-host.com')
7593
.get('/orgs/myorg')
@@ -89,6 +107,25 @@ describe('authentication', () => {
89107
return github.orgs.get({org: 'myorg'})
90108
})
91109

110+
it('oauth key & secret with query', () => {
111+
nock('https://authentication-test-host.com')
112+
.get('/orgs/myorg/repos')
113+
.query({per_page: 1, client_id: 'oauthkey', client_secret: 'oauthsecret'})
114+
.reply(200, [])
115+
116+
const github = new GitHub({
117+
host: 'authentication-test-host.com'
118+
})
119+
120+
github.authenticate({
121+
type: 'oauth',
122+
key: 'oauthkey',
123+
secret: 'oauthsecret'
124+
})
125+
126+
return github.repos.getForOrg({org: 'myorg', per_page: 1})
127+
})
128+
92129
it('integration', () => {
93130
nock('https://authentication-test-host.com', {
94131
reqheaders: {

0 commit comments

Comments
 (0)
Please sign in to comment.