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
Léo-Paul Géneau
gitlab-ce
Commits
1da4ae71
Commit
1da4ae71
authored
Oct 03, 2018
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spec for Status::Pipeline::Scheduled
parent
5f3c1a54
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
0 deletions
+46
-0
spec/factories/ci/pipelines.rb
spec/factories/ci/pipelines.rb
+4
-0
spec/lib/gitlab/ci/status/pipeline/scheduled_spec.rb
spec/lib/gitlab/ci/status/pipeline/scheduled_spec.rb
+42
-0
No files found.
spec/factories/ci/pipelines.rb
View file @
1da4ae71
...
@@ -54,6 +54,10 @@ FactoryBot.define do
...
@@ -54,6 +54,10 @@ FactoryBot.define do
status
:manual
status
:manual
end
end
trait
:scheduled
do
status
:scheduled
end
trait
:success
do
trait
:success
do
status
:success
status
:success
end
end
...
...
spec/lib/gitlab/ci/status/pipeline/scheduled_spec.rb
0 → 100644
View file @
1da4ae71
require
'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Pipeline
::
Scheduled
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
'scheduled'
end
end
describe
'#label'
do
it
'overrides status label'
do
expect
(
subject
.
label
).
to
eq
'waiting for delayed job'
end
end
describe
'.matches?'
do
let
(
:user
)
{
double
(
'user'
)
}
subject
{
described_class
.
matches?
(
pipeline
,
user
)
}
context
'when pipeline is scheduled'
do
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
:scheduled
)
}
it
'is a correct match'
do
expect
(
subject
).
to
be
true
end
end
context
'when pipeline is not scheduled'
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