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
cc6f578d
Commit
cc6f578d
authored
Dec 15, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use described_class and update description
Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7333#note_20059124
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7333#note_20059187
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7333#note_20059322
parent
f463ef5e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+9
-9
commit_spec.rb
spec/models/commit_spec.rb
+1
-1
No files found.
spec/models/ci/pipeline_spec.rb
View file @
cc6f578d
...
...
@@ -381,7 +381,7 @@ describe Ci::Pipeline, models: true do
end
end
shared_context
'with some
empty
pipelines'
do
shared_context
'with some
outdated
pipelines'
do
before
do
create_pipeline
(
:canceled
,
'ref'
,
'A'
)
create_pipeline
(
:success
,
'ref'
,
'A'
)
...
...
@@ -395,10 +395,10 @@ describe Ci::Pipeline, models: true do
end
describe
'.latest'
do
include_context
'with some
empty
pipelines'
include_context
'with some
outdated
pipelines'
context
'when no ref is specified'
do
let
(
:pipelines
)
{
Ci
::
Pipeline
.
latest
.
all
}
let
(
:pipelines
)
{
described_class
.
latest
.
all
}
it
'returns the latest pipeline for the same ref and different sha'
do
expect
(
pipelines
.
map
(
&
:sha
)).
to
contain_exactly
(
'A'
,
'B'
,
'C'
)
...
...
@@ -408,7 +408,7 @@ describe Ci::Pipeline, models: true do
end
context
'when ref is specified'
do
let
(
:pipelines
)
{
Ci
::
Pipeline
.
latest
(
'ref'
).
all
}
let
(
:pipelines
)
{
described_class
.
latest
(
'ref'
).
all
}
it
'returns the latest pipeline for ref and different sha'
do
expect
(
pipelines
.
map
(
&
:sha
)).
to
contain_exactly
(
'A'
,
'B'
)
...
...
@@ -419,21 +419,21 @@ describe Ci::Pipeline, models: true do
end
describe
'.latest_status'
do
include_context
'with some
empty
pipelines'
include_context
'with some
outdated
pipelines'
context
'when no ref is specified'
do
let
(
:latest_status
)
{
Ci
::
Pipeline
.
latest_status
}
let
(
:latest_status
)
{
described_class
.
latest_status
}
it
'returns the latest status for the same ref and different sha'
do
expect
(
latest_status
).
to
eq
(
Ci
::
Pipeline
.
latest
.
status
)
expect
(
latest_status
).
to
eq
(
described_class
.
latest
.
status
)
end
end
context
'when ref is specified'
do
let
(
:latest_status
)
{
Ci
::
Pipeline
.
latest_status
(
'ref'
)
}
let
(
:latest_status
)
{
described_class
.
latest_status
(
'ref'
)
}
it
'returns the latest status for ref and different sha'
do
expect
(
latest_status
).
to
eq
(
Ci
::
Pipeline
.
latest_status
(
'ref'
))
expect
(
latest_status
).
to
eq
(
described_class
.
latest_status
(
'ref'
))
end
end
end
...
...
spec/models/commit_spec.rb
View file @
cc6f578d
...
...
@@ -213,7 +213,7 @@ eos
end
describe
'#status'
do
context
'without
arguments
'
do
context
'without
ref argument
'
do
before
do
%w[success failed created pending]
.
each
do
|
status
|
create
(
:ci_empty_pipeline
,
...
...
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