summaryrefslogtreecommitdiff
path: root/spec/controllers/projects/security/configuration_controller_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers/projects/security/configuration_controller_spec.rb')
-rw-r--r--spec/controllers/projects/security/configuration_controller_spec.rb36
1 files changed, 11 insertions, 25 deletions
diff --git a/spec/controllers/projects/security/configuration_controller_spec.rb b/spec/controllers/projects/security/configuration_controller_spec.rb
index ef255d1efd0..848db16fb02 100644
--- a/spec/controllers/projects/security/configuration_controller_spec.rb
+++ b/spec/controllers/projects/security/configuration_controller_spec.rb
@@ -13,42 +13,28 @@ RSpec.describe Projects::Security::ConfigurationController do
end
describe 'GET show' do
- context 'when feature flag is disabled' do
+ context 'when user has guest access' do
before do
- stub_feature_flags(secure_security_and_compliance_configuration_page_on_ce: false)
+ project.add_guest(user)
end
- it 'renders not found' do
+ it 'denies access' do
get :show, params: { namespace_id: project.namespace, project_id: project }
- expect(response).to have_gitlab_http_status(:not_found)
+ expect(response).to have_gitlab_http_status(:forbidden)
end
end
- context 'when feature flag is enabled' do
- context 'when user has guest access' do
- before do
- project.add_guest(user)
- end
-
- it 'denies access' do
- get :show, params: { namespace_id: project.namespace, project_id: project }
-
- expect(response).to have_gitlab_http_status(:forbidden)
- end
+ context 'when user has developer access' do
+ before do
+ project.add_developer(user)
end
- context 'when user has developer access' do
- before do
- project.add_developer(user)
- end
-
- it 'grants access' do
- get :show, params: { namespace_id: project.namespace, project_id: project }
+ it 'grants access' do
+ get :show, params: { namespace_id: project.namespace, project_id: project }
- expect(response).to have_gitlab_http_status(:ok)
- expect(response).to render_template(:show)
- end
+ expect(response).to have_gitlab_http_status(:ok)
+ expect(response).to render_template(:show)
end
end
end