Skip to content

Commit 2b827f5

Browse files
committed
Options pass through to oauth2 client.
1 parent faa385a commit 2b827f5

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

spec/jira/oauth2_client_spec.rb

+12-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,18 @@ def query_params_to_h(uri)
192192
end
193193

194194
context 'passing options to oauth2 client' do
195-
it 'passes oauth2 client options to creating oauth2 client'
195+
let(:oauth2_client) { instance_double(OAuth2::Client) }
196+
subject(:request_client) do
197+
JIRA::Oauth2Client.new(full_options)
198+
end
199+
200+
it 'passes oauth2 client options to creating oauth2 client' do
201+
expect(OAuth2::Client).to receive(:new).with(client_id, client_secret, request_client.oauth2_client_options).and_return(oauth2_client)
202+
203+
oauth2_client_result = request_client.oauth2_client
204+
205+
expect(oauth2_client_result).to eq(oauth2_client)
206+
end
196207
end
197208
end
198209
end

0 commit comments

Comments
 (0)