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 | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/spec/requests/jira_connect/public_keys_controller_spec.rb b/spec/requests/jira_connect/public_keys_controller_spec.rb index bf472469d85..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,25 +30,25 @@ 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 - end - context 'when jira_connect_oauth_self_managed disabled' do - before do - stub_feature_flags(jira_connect_oauth_self_managed: false) - 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) + it 'renders 404' do + get jira_connect_public_key_path(id: uuid) - expect(response).to have_gitlab_http_status(:not_found) + expect(response).to have_gitlab_http_status(:ok) + end end end end |