diff options
Diffstat (limited to 'spec/support/shared_context.rb')
| -rw-r--r-- | spec/support/shared_context.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/support/shared_context.rb b/spec/support/shared_context.rb index e7416f2f1..e9b0025a2 100644 --- a/spec/support/shared_context.rb +++ b/spec/support/shared_context.rb @@ -5,3 +5,11 @@ shared_context 'iboo authenticated api user' do request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(api_key.organisation.code, api_key.token) end end + +shared_context 'iboo wrong authorisation api user' do + let(:api_key) { create(:api_key, organisation: organisation) } + + before do + request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials('fake code', api_key.token) + end +end |
