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
e4bb25f0
Commit
e4bb25f0
authored
Mar 01, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Projects::Settings::CiCdController#reset_cache specs
parent
7fc88fd7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
14 deletions
+5
-14
spec/controllers/projects/settings/ci_cd_controller_spec.rb
spec/controllers/projects/settings/ci_cd_controller_spec.rb
+5
-14
No files found.
spec/controllers/projects/settings/ci_cd_controller_spec.rb
View file @
e4bb25f0
...
...
@@ -27,7 +27,7 @@ describe Projects::Settings::CiCdController do
allow
(
ResetProjectCacheService
).
to
receive_message_chain
(
:new
,
:execute
).
and_return
(
true
)
end
subject
{
post
:reset_cache
,
namespace_id:
project
.
namespace
,
project_id:
project
}
subject
{
post
:reset_cache
,
namespace_id:
project
.
namespace
,
project_id:
project
,
format: :json
}
it
'calls reset project cache service'
do
expect
(
ResetProjectCacheService
).
to
receive_message_chain
(
:new
,
:execute
)
...
...
@@ -35,19 +35,11 @@ describe Projects::Settings::CiCdController do
subject
end
it
'redirects to project pipelines path'
do
subject
expect
(
response
).
to
have_gitlab_http_status
(
:redirect
)
expect
(
response
).
to
redirect_to
(
project_pipelines_path
(
project
))
end
context
'when service returns successfully'
do
it
'
sets the flash notice variable
'
do
it
'
returns a success header
'
do
subject
expect
(
controller
).
to
set_flash
[
:notice
]
expect
(
controller
).
not_to
set_flash
[
:error
]
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
end
end
...
...
@@ -56,11 +48,10 @@ describe Projects::Settings::CiCdController do
allow
(
ResetProjectCacheService
).
to
receive_message_chain
(
:new
,
:execute
).
and_return
(
false
)
end
it
'
sets the flash error variable
'
do
it
'
returns an error header
'
do
subject
expect
(
controller
).
not_to
set_flash
[
:notice
]
expect
(
controller
).
to
set_flash
[
:error
]
expect
(
response
).
to
have_gitlab_http_status
(
:bad_request
)
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