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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
5197b143
Commit
5197b143
authored
Apr 04, 2018
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update tests for settings/ci_cd_controller_spec
parent
a52e3edd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
11 deletions
+35
-11
spec/controllers/projects/settings/ci_cd_controller_spec.rb
spec/controllers/projects/settings/ci_cd_controller_spec.rb
+35
-11
No files found.
spec/controllers/projects/settings/ci_cd_controller_spec.rb
View file @
5197b143
...
...
@@ -58,27 +58,27 @@ describe Projects::Settings::CiCdController do
end
describe
'PATCH update'
do
let
(
:params
)
{
{
ci_config_path:
''
}
}
subject
do
patch
:update
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
,
project:
{
auto_devops_attributes:
params
}
project:
params
end
context
'when updating the auto_devops settings
'
do
let
(
:params
)
{
{
enabled:
''
,
domain:
'mepmep.md'
}
}
it
'redirects to the settings page
'
do
subject
it
'redirects to the settings page'
do
subject
expect
(
response
).
to
have_gitlab_http_status
(
302
)
expect
(
flash
[
:notice
]).
to
eq
(
"Pipelines settings for '
#{
project
.
name
}
' were successfully updated."
)
end
expect
(
response
).
to
have_gitlab_http_status
(
302
)
expect
(
flash
[
:notice
]).
to
eq
(
"Pipelines settings for '
#{
project
.
name
}
' were successfully updated."
)
end
context
'when updating the auto_devops settings'
do
let
(
:params
)
{
{
auto_devops_attributes:
{
enabled:
''
,
domain:
'mepmep.md'
}
}
}
context
'following the instance default'
do
let
(
:params
)
{
{
enabled:
''
}
}
let
(
:params
)
{
{
auto_devops_attributes:
{
enabled:
''
}
}
}
it
'allows enabled to be set to nil'
do
subject
...
...
@@ -134,5 +134,29 @@ describe Projects::Settings::CiCdController do
end
end
end
context
'when updating general settings'
do
context
'when build_timeout_human_readable is not specified'
do
let
(
:params
)
{
{
build_timeout_human_readable:
''
}
}
it
'set default timeout'
do
subject
project
.
reload
expect
(
project
.
build_timeout
).
to
eq
(
3600
)
end
end
context
'when build_timeout_human_readable is specified'
do
let
(
:params
)
{
{
build_timeout_human_readable:
'1h 30m'
}
}
it
'set specified timeout'
do
subject
project
.
reload
expect
(
project
.
build_timeout
).
to
eq
(
5400
)
end
end
end
end
end
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