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
fd115bc1
Commit
fd115bc1
authored
Jan 09, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for two new methods defined in stage class
parent
8dbd1e7d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
1 deletion
+48
-1
spec/lib/gitlab/ci/status/stage/factory_spec.rb
spec/lib/gitlab/ci/status/stage/factory_spec.rb
+0
-1
spec/models/ci/stage_spec.rb
spec/models/ci/stage_spec.rb
+48
-0
No files found.
spec/lib/gitlab/ci/status/stage/factory_spec.rb
View file @
fd115bc1
...
...
@@ -42,7 +42,6 @@ describe Gitlab::Ci::Status::Stage::Factory do
end
end
end
end
context
'when stage has warnings'
do
...
...
spec/models/ci/stage_spec.rb
View file @
fd115bc1
...
...
@@ -142,6 +142,54 @@ describe Ci::Stage, models: true do
end
end
describe
'#success?'
do
context
'when stage is successful'
do
before
do
create_job
(
:ci_build
,
status: :success
)
create_job
(
:generic_commit_status
,
status: :success
)
end
it
'is successful'
do
expect
(
stage
).
to
be_success
end
end
context
'when stage is not successful'
do
before
do
create_job
(
:ci_build
,
status: :failed
)
create_job
(
:generic_commit_status
,
status: :success
)
end
it
'is not successful'
do
expect
(
stage
).
not_to
be_success
end
end
end
describe
'#has_warnings?'
do
context
'when stage has warnings'
do
before
do
create
(
:ci_build
,
:failed
,
:allowed_to_fail
,
stage:
stage_name
,
pipeline:
pipeline
)
end
it
'has warnings'
do
expect
(
stage
).
to
have_warnings
end
end
context
'when stage does not have warnings'
do
before
do
create
(
:ci_build
,
:success
,
stage:
stage_name
,
pipeline:
pipeline
)
end
it
'does not have warnings'
do
expect
(
stage
).
not_to
have_warnings
end
end
end
def
create_job
(
type
,
status:
'success'
,
stage:
stage_name
)
create
(
type
,
pipeline:
pipeline
,
stage:
stage
,
status:
status
)
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