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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
a9e74255
Commit
a9e74255
authored
Oct 10, 2018
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve spec for Gitlab::Ci::Status::Pipeline::Factory
parent
f9bedcfc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
19 deletions
+49
-19
spec/lib/gitlab/ci/status/pipeline/factory_spec.rb
spec/lib/gitlab/ci/status/pipeline/factory_spec.rb
+49
-19
No files found.
spec/lib/gitlab/ci/status/pipeline/factory_spec.rb
View file @
a9e74255
...
@@ -11,7 +11,7 @@ describe Gitlab::Ci::Status::Pipeline::Factory do
...
@@ -11,7 +11,7 @@ describe Gitlab::Ci::Status::Pipeline::Factory do
end
end
context
'when pipeline has a core status'
do
context
'when pipeline has a core status'
do
HasStatus
::
AVAILABLE_STATUSES
.
each
do
|
simple_status
|
(
HasStatus
::
AVAILABLE_STATUSES
-
HasStatus
::
BLOCKED_STATUS
)
.
each
do
|
simple_status
|
context
"when core status is
#{
simple_status
}
"
do
context
"when core status is
#{
simple_status
}
"
do
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
status:
simple_status
)
}
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
status:
simple_status
)
}
...
@@ -23,17 +23,6 @@ describe Gitlab::Ci::Status::Pipeline::Factory do
...
@@ -23,17 +23,6 @@ describe Gitlab::Ci::Status::Pipeline::Factory do
expect
(
factory
.
core_status
).
to
be_a
expected_status
expect
(
factory
.
core_status
).
to
be_a
expected_status
end
end
if
simple_status
==
'manual'
it
'matches a correct extended statuses'
do
expect
(
factory
.
extended_statuses
)
.
to
eq
[
Gitlab
::
Ci
::
Status
::
Pipeline
::
Blocked
]
end
elsif
simple_status
==
'scheduled'
it
'matches a correct extended statuses'
do
expect
(
factory
.
extended_statuses
)
.
to
eq
[
Gitlab
::
Ci
::
Status
::
Pipeline
::
Scheduled
]
end
else
it
'does not match extended statuses'
do
it
'does not match extended statuses'
do
expect
(
factory
.
extended_statuses
).
to
be_empty
expect
(
factory
.
extended_statuses
).
to
be_empty
end
end
...
@@ -41,6 +30,27 @@ describe Gitlab::Ci::Status::Pipeline::Factory do
...
@@ -41,6 +30,27 @@ describe Gitlab::Ci::Status::Pipeline::Factory do
it
"fabricates a core status
#{
simple_status
}
"
do
it
"fabricates a core status
#{
simple_status
}
"
do
expect
(
status
).
to
be_a
expected_status
expect
(
status
).
to
be_a
expected_status
end
end
it
'extends core status with common pipeline methods'
do
expect
(
status
).
to
have_details
expect
(
status
).
not_to
have_action
expect
(
status
.
details_path
)
.
to
include
"pipelines/
#{
pipeline
.
id
}
"
end
end
end
context
"when core status is manual"
do
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
status: :manual
)
}
it
"matches manual core status"
do
expect
(
factory
.
core_status
)
.
to
be_a
Gitlab
::
Ci
::
Status
::
Manual
end
it
'matches a correct extended statuses'
do
expect
(
factory
.
extended_statuses
)
.
to
eq
[
Gitlab
::
Ci
::
Status
::
Pipeline
::
Blocked
]
end
end
it
'extends core status with common pipeline methods'
do
it
'extends core status with common pipeline methods'
do
...
@@ -50,6 +60,26 @@ describe Gitlab::Ci::Status::Pipeline::Factory do
...
@@ -50,6 +60,26 @@ describe Gitlab::Ci::Status::Pipeline::Factory do
.
to
include
"pipelines/
#{
pipeline
.
id
}
"
.
to
include
"pipelines/
#{
pipeline
.
id
}
"
end
end
end
end
context
"when core status is scheduled"
do
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
status: :scheduled
)
}
it
"matches scheduled core status"
do
expect
(
factory
.
core_status
)
.
to
be_a
Gitlab
::
Ci
::
Status
::
Scheduled
end
it
'matches a correct extended statuses'
do
expect
(
factory
.
extended_statuses
)
.
to
eq
[
Gitlab
::
Ci
::
Status
::
Pipeline
::
Scheduled
]
end
it
'extends core status with common pipeline methods'
do
expect
(
status
).
to
have_details
expect
(
status
).
not_to
have_action
expect
(
status
.
details_path
)
.
to
include
"pipelines/
#{
pipeline
.
id
}
"
end
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