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
cc8b8a60
Commit
cc8b8a60
authored
Sep 26, 2018
by
Shinya Maeda
Committed by
Alessio Caiazza
Oct 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add unit spec for Ci::Pipeline
parent
9266cd5e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
spec/models/ci/pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+25
-0
No files found.
spec/models/ci/pipeline_spec.rb
View file @
cc8b8a60
...
...
@@ -75,6 +75,18 @@ describe Ci::Pipeline, :mailer do
end
end
describe
'#schedule'
do
subject
{
pipeline
.
schedule
}
let
(
:pipeline
)
{
build
(
:ci_pipeline
,
status: :created
)
}
it
'changes pipeline status to schedule'
do
subject
expect
(
pipeline
).
to
be_scheduled
end
end
describe
'#valid_commit_sha'
do
context
'commit.sha can not start with 00000000'
do
before
do
...
...
@@ -1288,6 +1300,19 @@ describe Ci::Pipeline, :mailer do
end
end
context
'when updating status to scheduled'
do
before
do
allow
(
pipeline
)
.
to
receive_message_chain
(
:statuses
,
:latest
,
:status
)
.
and_return
(
:scheduled
)
end
it
'updates pipeline status to scheduled'
do
expect
{
pipeline
.
update_status
}
.
to
change
{
pipeline
.
reload
.
status
}.
to
'scheduled'
end
end
context
'when statuses status was not recognized'
do
before
do
allow
(
pipeline
)
...
...
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