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
iv
gitlab-ce
Commits
88aacaa7
Commit
88aacaa7
authored
Jul 20, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reuse those two methods
parent
a7713232
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
19 deletions
+10
-19
spec/models/project_spec.rb
spec/models/project_spec.rb
+10
-19
No files found.
spec/models/project_spec.rb
View file @
88aacaa7
...
@@ -1115,19 +1115,23 @@ describe Project, models: true do
...
@@ -1115,19 +1115,23 @@ describe Project, models: true do
end
end
describe
'#latest_successful_builds_for'
do
describe
'#latest_successful_builds_for'
do
let
(
:project
)
{
create
(
:project
)
}
def
create_pipeline
let
(
:pipeline
)
do
create
(
:ci_pipeline
,
project:
project
,
create
(
:ci_pipeline
,
project:
project
,
sha:
project
.
commit
.
id
,
sha:
project
.
commit
.
sha
,
ref:
project
.
default_branch
,
ref:
project
.
default_branch
,
status:
'success'
)
status:
'success'
)
end
end
let
(
:build
)
do
def
create_build
(
new_pipeline
=
pipeline
,
name
=
'test'
)
create
(
:ci_build
,
:artifacts
,
:success
,
pipeline:
pipeline
)
create
(
:ci_build
,
:success
,
:artifacts
,
pipeline:
new_pipeline
,
name:
name
)
end
end
let
(
:project
)
{
create
(
:project
)
}
let
(
:pipeline
)
{
create_pipeline
}
let
(
:build
)
{
create_build
}
context
'with succeeded pipeline'
do
context
'with succeeded pipeline'
do
context
'standalone pipeline'
do
context
'standalone pipeline'
do
before
do
before
do
...
@@ -1163,19 +1167,6 @@ describe Project, models: true do
...
@@ -1163,19 +1167,6 @@ describe Project, models: true do
expect
(
latest_builds
).
to
contain_exactly
(
@build2_p2
,
@build1_p2
)
expect
(
latest_builds
).
to
contain_exactly
(
@build2_p2
,
@build1_p2
)
end
end
def
create_pipeline
create
(
:ci_pipeline
,
project:
project
,
sha:
project
.
commit
.
sha
,
ref:
project
.
default_branch
,
status:
'success'
)
end
def
create_build
(
pipe
,
name
=
'test'
)
create
(
:ci_build
,
:success
,
:artifacts
,
pipeline:
pipe
,
name:
name
)
end
end
end
context
'with multiple pipelines and builds'
do
context
'with multiple pipelines and builds'
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