Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
b213e395
Commit
b213e395
authored
Dec 10, 2021
by
Kev
Committed by
Fabio Pitino
Dec 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix CI/CD settings available when CI/CD is off
Changelog: fixed
parent
dc506f52
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
app/controllers/projects/settings/ci_cd_controller.rb
app/controllers/projects/settings/ci_cd_controller.rb
+1
-0
spec/controllers/projects/settings/ci_cd_controller_spec.rb
spec/controllers/projects/settings/ci_cd_controller_spec.rb
+11
-0
No files found.
app/controllers/projects/settings/ci_cd_controller.rb
View file @
b213e395
...
@@ -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
)
...
...
spec/controllers/projects/settings/ci_cd_controller_spec.rb
View file @
b213e395
...
@@ -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
])
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment