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
2a435e1d
Commit
2a435e1d
authored
Aug 11, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Pipeline#latest in favour of Project#pipeline_for(ref)
parent
71046cc6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
25 deletions
+7
-25
pipeline.rb
app/models/ci/pipeline.rb
+0
-4
pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+7
-21
No files found.
app/models/ci/pipeline.rb
View file @
2a435e1d
...
...
@@ -102,10 +102,6 @@ module Ci
end
end
def
latest
project
.
pipelines
.
latest_for
(
ref
).
first
end
def
latest?
return
false
unless
ref
commit
=
project
.
commit
(
ref
)
...
...
spec/models/ci/pipeline_spec.rb
View file @
2a435e1d
...
...
@@ -483,7 +483,13 @@ describe Ci::Pipeline, models: true do
context
'with non-empty project'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:pipeline
)
{
create_pipeline
}
let
(
:pipeline
)
do
create
(
:ci_pipeline
,
project:
project
,
ref:
project
.
default_branch
,
sha:
project
.
commit
.
sha
)
end
describe
'#latest?'
do
context
'with latest sha'
do
...
...
@@ -503,26 +509,6 @@ describe Ci::Pipeline, models: true do
end
end
end
describe
'#latest'
do
let
(
:previous_pipeline
)
{
create_pipeline
}
before
do
previous_pipeline
pipeline
end
it
'gives the latest pipeline'
do
expect
(
previous_pipeline
.
latest
).
to
eq
(
pipeline
)
end
end
def
create_pipeline
create
(
:ci_pipeline
,
project:
project
,
ref:
project
.
default_branch
,
sha:
project
.
commit
.
sha
)
end
end
describe
'#manual_actions'
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