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
ee18d89f
Commit
ee18d89f
authored
Jan 12, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend pipeline detailed status factory specs
parent
528c0688
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
17 deletions
+28
-17
spec/lib/gitlab/ci/status/pipeline/factory_spec.rb
spec/lib/gitlab/ci/status/pipeline/factory_spec.rb
+28
-17
No files found.
spec/lib/gitlab/ci/status/pipeline/factory_spec.rb
View file @
ee18d89f
...
...
@@ -3,29 +3,32 @@ require 'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Pipeline
::
Factory
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
pipeline
.
project
}
subject
do
described_class
.
new
(
pipeline
,
user
)
end
let
(
:status
)
do
subject
.
fabricate!
end
let
(
:status
)
{
factory
.
fabricate!
}
let
(
:factory
)
{
described_class
.
new
(
pipeline
,
user
)
}
before
do
project
.
team
<<
[
user
,
:developer
]
end
context
'when pipeline has a core status'
do
HasStatus
::
AVAILABLE_STATUSES
.
each
do
|
core_status
|
context
"when core status is
#{
core_status
}
"
do
let
(
:pipeline
)
do
create
(
:ci_pipeline
,
status:
core_status
)
HasStatus
::
AVAILABLE_STATUSES
.
each
do
|
simple_status
|
context
"when core status is
#{
simple_status
}
"
do
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
status:
simple_status
)
}
let
(
:expected_status
)
do
Gitlab
::
Ci
::
Status
.
const_get
(
simple_status
.
capitalize
)
end
it
"matches correct core status for
#{
simple_status
}
"
do
expect
(
factory
.
core_status
).
to
be_a
expected_status
end
it
"fabricates a core status
#{
core_status
}
"
do
expect
(
status
).
to
be_a
(
Gitlab
::
Ci
::
Status
.
const_get
(
core_status
.
capitalize
))
it
'does not matche extended statuses'
do
expect
(
factory
.
extended_statuses
).
to
be_empty
end
it
"fabricates a core status
#{
simple_status
}
"
do
expect
(
status
).
to
be_a
expected_status
end
it
'extends core status with common pipeline methods'
do
...
...
@@ -47,9 +50,17 @@ describe Gitlab::Ci::Status::Pipeline::Factory do
create
(
:ci_build
,
:allowed_to_fail
,
:failed
,
pipeline:
pipeline
)
end
it
'matches correct core status'
do
expect
(
factory
.
core_status
).
to
be_a
Gitlab
::
Ci
::
Status
::
Success
end
it
'matches correct extended statuses'
do
expect
(
factory
.
extended_statuses
)
.
to
eq
[
Gitlab
::
Ci
::
Status
::
SuccessWarning
]
end
it
'fabricates extended "success with warnings" status'
do
expect
(
status
)
.
to
be_a
Gitlab
::
Ci
::
Status
::
SuccessWarning
expect
(
status
).
to
be_a
Gitlab
::
Ci
::
Status
::
SuccessWarning
end
it
'extends core status with common pipeline method'
do
...
...
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