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
cb4c9a03
Commit
cb4c9a03
authored
Mar 06, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend specs for code we use to calculate statuses
parent
80c463d9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
+40
-0
spec/factories/commit_statuses.rb
spec/factories/commit_statuses.rb
+4
-0
spec/models/concerns/has_status_spec.rb
spec/models/concerns/has_status_spec.rb
+36
-0
No files found.
spec/factories/commit_statuses.rb
View file @
cb4c9a03
...
...
@@ -35,6 +35,10 @@ FactoryGirl.define do
status
'created'
end
trait
:manual
do
status
'manual'
end
after
(
:build
)
do
|
build
,
evaluator
|
build
.
project
=
build
.
pipeline
.
project
end
...
...
spec/models/concerns/has_status_spec.rb
View file @
cb4c9a03
...
...
@@ -109,6 +109,24 @@ describe HasStatus do
it
{
is_expected
.
to
eq
'running'
}
end
context
'when one status is a blocking manual action'
do
let!
(
:statuses
)
do
[
create
(
type
,
status: :failed
),
create
(
type
,
status: :manual
,
allow_failure:
false
)]
end
it
{
is_expected
.
to
eq
'manual'
}
end
context
'when one status is a non-blocking manual action'
do
let!
(
:statuses
)
do
[
create
(
type
,
status: :failed
),
create
(
type
,
status: :manual
,
allow_failure:
true
)]
end
it
{
is_expected
.
to
eq
'failed'
}
end
end
context
'ci build statuses'
do
...
...
@@ -218,6 +236,18 @@ describe HasStatus do
it_behaves_like
'not containing the job'
,
status
end
end
describe
'.manual'
do
subject
{
CommitStatus
.
manual
}
%i[manual]
.
each
do
|
status
|
it_behaves_like
'containing the job'
,
status
end
%i[failed success skipped canceled]
.
each
do
|
status
|
it_behaves_like
'not containing the job'
,
status
end
end
end
describe
'::DEFAULT_STATUS'
do
...
...
@@ -225,4 +255,10 @@ describe HasStatus do
expect
(
described_class
::
DEFAULT_STATUS
).
to
eq
'created'
end
end
describe
'::BLOCKED_STATUS'
do
it
'is a status manual'
do
expect
(
described_class
::
BLOCKED_STATUS
).
to
eq
'manual'
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