diff options
Diffstat (limited to 'spec/support/shared_context.rb')
| -rw-r--r-- | spec/support/shared_context.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/support/shared_context.rb b/spec/support/shared_context.rb index e9b0025a2..5e472eb85 100644 --- a/spec/support/shared_context.rb +++ b/spec/support/shared_context.rb @@ -13,3 +13,19 @@ shared_context 'iboo wrong authorisation api user' do request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials('fake code', api_key.token) end end + +shared_context 'iboo authenticated internal api' do + let(:api_key) { Rails.application.secrets.api_token } + + before do + request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Token.encode_credentials(api_key) + end +end + +shared_context 'iboo wrong authorisation internal api' do + let(:api_key) { "false_api_token" } + + before do + request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Token.encode_credentials(api_key) + end +end |
