Commit d4b666a0 authored by Fabio Pitino's avatar Fabio Pitino

Merge branch '214334-Fix-CI-CD-settings-available-when-CI-CD-is-off' into 'master'

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

See merge request gitlab-org/gitlab!76009
parents cd135faa b213e395
......@@ -9,6 +9,7 @@ module Projects
layout 'project_settings'
before_action :authorize_admin_pipeline!
before_action :check_builds_available!
before_action :define_variables
before_action do
push_frontend_feature_flag(:ajax_new_deploy_token, @project)
......
......@@ -25,6 +25,17 @@ RSpec.describe Projects::Settings::CiCdController do
expect(response).to render_template(:show)
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
let_it_be(:group_runner) { create(:ci_runner, :group, groups: [group]) }
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