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
Jérome Perrin
gitlab-ce
Commits
8e603b62
Commit
8e603b62
authored
Dec 27, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing specs for new methods in pipeline class
parent
1b14182f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
0 deletions
+46
-0
spec/factories/ci/runners.rb
spec/factories/ci/runners.rb
+4
-0
spec/models/ci/pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+42
-0
No files found.
spec/factories/ci/runners.rb
View file @
8e603b62
...
@@ -8,6 +8,10 @@ FactoryGirl.define do
...
@@ -8,6 +8,10 @@ FactoryGirl.define do
is_shared
false
is_shared
false
active
true
active
true
trait
:online
do
contacted_at
Time
.
now
end
trait
:shared
do
trait
:shared
do
is_shared
true
is_shared
true
end
end
...
...
spec/models/ci/pipeline_spec.rb
View file @
8e603b62
...
@@ -875,6 +875,48 @@ describe Ci::Pipeline, models: true do
...
@@ -875,6 +875,48 @@ describe Ci::Pipeline, models: true do
end
end
end
end
describe
'#stuck?'
do
before
do
create
(
:ci_build
,
:pending
,
pipeline:
pipeline
)
end
context
'when pipeline is stuck'
do
it
'is stuck'
do
expect
(
pipeline
).
to
be_stuck
end
end
context
'when pipeline is not stuck'
do
before
{
create
(
:ci_runner
,
:shared
,
:online
)
}
it
'is not stuck'
do
expect
(
pipeline
).
not_to
be_stuck
end
end
end
describe
'#has_yaml_errors?'
do
context
'when pipeline has errors'
do
let
(
:pipeline
)
do
create
(
:ci_pipeline
,
config:
{
rspec:
nil
})
end
it
'contains yaml errors'
do
expect
(
pipeline
).
to
have_yaml_errors
end
end
context
'when pipeline does not have errors'
do
let
(
:pipeline
)
do
create
(
:ci_pipeline
,
config:
{
rspec:
{
script:
'rake test'
}
})
end
it
'does not containyaml errors'
do
expect
(
pipeline
).
not_to
have_yaml_errors
end
end
end
describe
'notifications when pipeline success or failed'
do
describe
'notifications when pipeline success or failed'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
...
...
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