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
82327ea7
Commit
82327ea7
authored
Mar 08, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for an extended blocked pipeline status
parent
c83be391
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
0 deletions
+50
-0
spec/factories/ci/pipelines.rb
spec/factories/ci/pipelines.rb
+8
-0
spec/lib/gitlab/ci/status/pipeline/blocked_spec.rb
spec/lib/gitlab/ci/status/pipeline/blocked_spec.rb
+42
-0
No files found.
spec/factories/ci/pipelines.rb
View file @
82327ea7
...
@@ -40,6 +40,14 @@ FactoryGirl.define do
...
@@ -40,6 +40,14 @@ FactoryGirl.define do
trait
:invalid
do
trait
:invalid
do
config
(
rspec:
nil
)
config
(
rspec:
nil
)
end
end
trait
:blocked
do
status
:manual
end
trait
:success
do
status
:success
end
end
end
end
end
end
end
spec/lib/gitlab/ci/status/pipeline/blocked_spec.rb
0 → 100644
View file @
82327ea7
require
'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Pipeline
::
Blocked
do
let
(
:pipeline
)
{
double
(
'pipeline'
)
}
subject
do
described_class
.
new
(
pipeline
)
end
describe
'#text'
do
it
'overrides status text'
do
expect
(
subject
.
text
).
to
eq
'blocked'
end
end
describe
'#label'
do
it
'overrides status label'
do
expect
(
subject
.
label
).
to
eq
'waiting for manual action'
end
end
describe
'.matches?'
do
let
(
:user
)
{
double
(
'user'
)
}
subject
{
described_class
.
matches?
(
pipeline
,
user
)
}
context
'when pipeline is blocked'
do
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
:blocked
)
}
it
'is a correct match'
do
expect
(
subject
).
to
be
true
end
end
context
'when pipeline is not blocked'
do
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
:success
)
}
it
'does not match'
do
expect
(
subject
).
to
be
false
end
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