Skip to content

Commit

Permalink
Refactor token refreshment hook spec
Browse files Browse the repository at this point in the history
  • Loading branch information
jgorset committed Feb 11, 2016
1 parent af33cca commit c35f524
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec/lib/openid_token_proxy/token/refresh_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ def index
context 'when token was refreshed successfully' do
it 'executes actions normally returning new tokens as headers' do
OpenIDTokenProxy.configure_temporarily do |config|
block = double('block')
config.token_refreshment_hook = proc { |token| block.run(token) }
expect(block).to receive(:run).with(instance_of(OpenIDTokenProxy::Token))
get :index, refresh_token: refresh_token
expect do |probe|
config.token_refreshment_hook = probe
get :index, refresh_token: refresh_token
end.to yield_with_args(instance_of(OpenIDTokenProxy::Token))
expect(response).to have_http_status :ok
expect(response.body).to eq 'Refresh successful'
expect(response.headers['X-Token']).to eq 'new access token'
Expand Down

0 comments on commit c35f524

Please sign in to comment.