diff options
| author | cedricnjanga | 2017-12-05 23:37:17 +0100 |
|---|---|---|
| committer | cedricnjanga | 2017-12-05 23:37:17 +0100 |
| commit | 00fa87ab96185bbcdc1ce2f1d19230e5a1dcc77f (patch) | |
| tree | 1be8a7bb6de44baa6e19bdaaf8d51c05e170e73d /spec/support | |
| parent | 9f1aa4d40d7d968963dae5799e15ad5da4cbcbc5 (diff) | |
| download | chouette-core-00fa87ab96185bbcdc1ce2f1d19230e5a1dcc77f.tar.bz2 | |
Add some changes according to PR review
Diffstat (limited to 'spec/support')
| -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 |
