BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
3e6a527e
Commit
3e6a527e
authored
Oct 28, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for Commit#status and Commit#status_for, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7034#note_17543036
parent
f4b9de38
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
1 deletion
+44
-1
commit_spec.rb
spec/models/commit_spec.rb
+44
-1
No files found.
spec/models/commit_spec.rb
View file @
3e6a527e
...
@@ -210,7 +210,50 @@ eos
...
@@ -210,7 +210,50 @@ eos
end
end
describe
'#status'
do
describe
'#status'
do
# TODO: kamil
shared_examples
'giving the status from pipeline'
do
it
do
expect
(
commit
.
status
).
to
eq
(
Ci
::
Pipeline
.
status
)
end
end
context
'with pipelines'
do
let!
(
:pipeline
)
do
create
(
:ci_empty_pipeline
,
project:
project
,
sha:
commit
.
sha
)
end
it_behaves_like
'giving the status from pipeline'
end
context
'without pipelines'
do
it_behaves_like
'giving the status from pipeline'
end
end
describe
'#status_for'
do
let!
(
:pipeline_from_master
)
do
create
(
:ci_empty_pipeline
,
project:
project
,
sha:
commit
.
sha
,
ref:
'master'
,
status:
'failed'
)
end
let!
(
:pipeline_from_fix
)
do
create
(
:ci_empty_pipeline
,
project:
project
,
sha:
commit
.
sha
,
ref:
'fix'
,
status:
'success'
)
end
it
'gives pipelines from a particular branch'
do
expect
(
commit
.
status_for
(
'master'
)).
to
eq
(
pipeline_from_master
.
status
)
expect
(
commit
.
status_for
(
'fix'
)).
to
eq
(
pipeline_from_fix
.
status
)
end
it
'gives compound status if ref is nil'
do
expect
(
commit
.
status_for
(
nil
)).
to
eq
(
commit
.
status
)
end
end
end
describe
'#participants'
do
describe
'#participants'
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