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
7fe14c42
Commit
7fe14c42
authored
Oct 02, 2018
by
Shinya Maeda
Committed by
Alessio Caiazza
Oct 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add integration spec
parent
49af84c2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
spec/controllers/projects/jobs_controller_spec.rb
spec/controllers/projects/jobs_controller_spec.rb
+40
-0
No files found.
spec/controllers/projects/jobs_controller_spec.rb
View file @
7fe14c42
...
@@ -632,6 +632,46 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
...
@@ -632,6 +632,46 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
end
end
end
end
describe
'POST unschedule'
do
before
do
project
.
add_developer
(
user
)
create
(
:protected_branch
,
:developers_can_merge
,
name:
'master'
,
project:
project
)
sign_in
(
user
)
post_unschedule
end
context
'when job is scheduled'
do
let
(
:job
)
{
create
(
:ci_build
,
:scheduled
,
pipeline:
pipeline
)
}
it
'redirects to the unscheduled job page'
do
expect
(
response
).
to
have_gitlab_http_status
(
:found
)
expect
(
response
).
to
redirect_to
(
namespace_project_job_path
(
id:
job
.
id
))
end
it
'transits to manual'
do
expect
(
job
.
reload
).
to
be_manual
end
end
context
'when job is not scheduled'
do
let
(
:job
)
{
create
(
:ci_build
,
pipeline:
pipeline
)
}
it
'renders unprocessable_entity'
do
expect
(
response
).
to
have_gitlab_http_status
(
:unprocessable_entity
)
end
end
def
post_unschedule
post
:unschedule
,
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
job
.
id
end
end
describe
'POST cancel_all'
do
describe
'POST cancel_all'
do
before
do
before
do
project
.
add_developer
(
user
)
project
.
add_developer
(
user
)
...
...
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