diff options
Diffstat (limited to 'spec/requests/jira_connect/public_keys_controller_spec.rb')
-rw-r--r-- | spec/requests/jira_connect/public_keys_controller_spec.rb | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/spec/requests/jira_connect/public_keys_controller_spec.rb b/spec/requests/jira_connect/public_keys_controller_spec.rb index 7f0262eaf65..62a81d43e65 100644 --- a/spec/requests/jira_connect/public_keys_controller_spec.rb +++ b/spec/requests/jira_connect/public_keys_controller_spec.rb @@ -5,11 +5,10 @@ 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_config) { true } + let(:public_key_storage_enabled) { true } before do - allow(Gitlab.config.jira_connect).to receive(:enable_public_keys_storage) - .and_return(public_key_storage_enabled_config) + stub_application_setting(jira_connect_public_key_storage_enabled: public_key_storage_enabled) end it 'renders 404' do @@ -30,26 +29,14 @@ RSpec.describe JiraConnect::PublicKeysController, feature_category: :integration expect(response.body).to eq(public_key.key) end - context 'when public key storage config disabled' do - let(:public_key_storage_enabled_config) { false } + context 'when public key storage setting disabled' do + let(:public_key_storage_enabled) { 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 |