Commit b213e395 authored by Kev's avatar Kev Committed by Fabio Pitino

Fix CI/CD settings available when CI/CD is off

Changelog: fixed
parent dc506f52
...@@ -9,6 +9,7 @@ module Projects ...@@ -9,6 +9,7 @@ module Projects
layout 'project_settings' layout 'project_settings'
before_action :authorize_admin_pipeline! before_action :authorize_admin_pipeline!
before_action :check_builds_available!
before_action :define_variables before_action :define_variables
before_action do before_action do
push_frontend_feature_flag(:ajax_new_deploy_token, @project) push_frontend_feature_flag(:ajax_new_deploy_token, @project)
......
...@@ -25,6 +25,17 @@ RSpec.describe Projects::Settings::CiCdController do ...@@ -25,6 +25,17 @@ RSpec.describe Projects::Settings::CiCdController do
expect(response).to render_template(:show) expect(response).to render_template(:show)
end end
context 'with CI/CD disabled' do
before do
project.project_feature.update_attribute(:builds_access_level, ProjectFeature::DISABLED)
end
it 'renders show with 404 status code' do
get :show, params: { namespace_id: project.namespace, project_id: project }
expect(response).to have_gitlab_http_status(:not_found)
end
end
context 'with group runners' do context 'with group runners' do
let_it_be(:group_runner) { create(:ci_runner, :group, groups: [group]) } let_it_be(:group_runner) { create(:ci_runner, :group, groups: [group]) }
let_it_be(:project_runner) { create(:ci_runner, :project, projects: [other_project]) } let_it_be(:project_runner) { create(:ci_runner, :project, projects: [other_project]) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment