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
9d372d0d
Commit
9d372d0d
authored
Nov 20, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a test
parent
65cadff1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
12 deletions
+19
-12
spec/workers/pipeline_schedule_worker_spec.rb
spec/workers/pipeline_schedule_worker_spec.rb
+19
-12
No files found.
spec/workers/pipeline_schedule_worker_spec.rb
View file @
9d372d0d
...
@@ -22,25 +22,32 @@ describe PipelineScheduleWorker do
...
@@ -22,25 +22,32 @@ describe PipelineScheduleWorker do
end
end
context
'when there is a scheduled pipeline within next_run_at'
do
context
'when there is a scheduled pipeline within next_run_at'
do
shared_examples
'successful scheduling'
do
it
'creates a new pipeline'
do
it
'creates a new pipeline'
do
expect
{
subject
}.
to
change
{
project
.
pipelines
.
count
}.
by
(
1
)
expect
{
subject
}.
to
change
{
project
.
pipelines
.
count
}.
by
(
1
)
pipeline_schedule
.
reload
expect
(
Ci
::
Pipeline
.
last
).
to
be_schedule
expect
(
Ci
::
Pipeline
.
last
).
to
be_schedule
expect
(
pipeline_schedule
.
next_run_at
).
to
be
>
Time
.
now
expect
(
pipeline_schedule
).
to
eq
(
project
.
pipelines
.
last
.
pipeline_schedule
)
expect
(
pipeline_schedule
).
to
be_active
end
end
end
it
'updates the next_run_at field'
do
it_behaves_like
'successful scheduling'
subject
expect
(
pipeline_schedule
.
reload
.
next_run_at
).
to
be
>
Time
.
now
context
'when the latest commit contains [ci skip]'
do
before
do
allow_any_instance_of
(
Ci
::
Pipeline
)
.
to
receive
(
:git_commit_message
)
.
and_return
(
'some commit [ci skip]'
)
end
end
it
'sets the schedule on the pipeline'
do
it_behaves_like
'successful scheduling'
subject
expect
(
project
.
pipelines
.
last
.
pipeline_schedule
).
to
eq
(
pipeline_schedule
)
end
end
end
end
context
'
inactive schedule
'
do
context
'
when the schedule is deactivated
'
do
before
do
before
do
pipeline_schedule
.
deactivate!
pipeline_schedule
.
deactivate!
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