summaryrefslogtreecommitdiff
path: root/spec/requests/jira_connect/public_keys_controller_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/requests/jira_connect/public_keys_controller_spec.rb')
-rw-r--r--spec/requests/jira_connect/public_keys_controller_spec.rb21
1 files changed, 17 insertions, 4 deletions
diff --git a/spec/requests/jira_connect/public_keys_controller_spec.rb b/spec/requests/jira_connect/public_keys_controller_spec.rb
index 31977f34d0f..7f0262eaf65 100644
--- a/spec/requests/jira_connect/public_keys_controller_spec.rb
+++ b/spec/requests/jira_connect/public_keys_controller_spec.rb
@@ -5,10 +5,11 @@ require 'spec_helper'
RSpec.describe JiraConnect::PublicKeysController, feature_category: :integrations do
describe 'GET /-/jira_connect/public_keys/:uuid' do
let(:uuid) { non_existing_record_id }
- let(:public_key_storage_enabled) { true }
+ let(:public_key_storage_enabled_config) { true }
before do
- allow(Gitlab.config.jira_connect).to receive(:enable_public_keys_storage).and_return(public_key_storage_enabled)
+ allow(Gitlab.config.jira_connect).to receive(:enable_public_keys_storage)
+ .and_return(public_key_storage_enabled_config)
end
it 'renders 404' do
@@ -29,14 +30,26 @@ RSpec.describe JiraConnect::PublicKeysController, feature_category: :integration
expect(response.body).to eq(public_key.key)
end
- context 'when public key storage disabled' do
- let(:public_key_storage_enabled) { false }
+ context 'when public key storage config disabled' do
+ let(:public_key_storage_enabled_config) { false }
it 'renders 404' do
get jira_connect_public_key_path(id: uuid)
expect(response).to have_gitlab_http_status(:not_found)
end
+
+ context 'when public key storage setting is enabled' do
+ before do
+ stub_application_setting(jira_connect_public_key_storage_enabled: true)
+ end
+
+ it 'renders 404' do
+ get jira_connect_public_key_path(id: uuid)
+
+ expect(response).to have_gitlab_http_status(:ok)
+ end
+ end
end
end
end