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
Léo-Paul Géneau
gitlab-ce
Commits
bac143ea
Commit
bac143ea
authored
Dec 01, 2017
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use actual head pipeline on merge request presenter
parent
5cf3ff27
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+14
-0
spec/presenters/merge_request_presenter_spec.rb
spec/presenters/merge_request_presenter_spec.rb
+1
-1
No files found.
spec/models/merge_request_spec.rb
View file @
bac143ea
...
@@ -838,6 +838,14 @@ describe MergeRequest do
...
@@ -838,6 +838,14 @@ describe MergeRequest do
expect
(
subject
.
head_pipeline
).
to
be_nil
expect
(
subject
.
head_pipeline
).
to
be_nil
end
end
context
'when the source project does not exist'
do
it
'returns nil'
do
allow
(
subject
).
to
receive
(
:source_project
).
and_return
(
nil
)
expect
(
subject
.
head_pipeline
).
to
be_nil
end
end
end
end
describe
'#actual_head_pipeline'
do
describe
'#actual_head_pipeline'
do
...
@@ -855,6 +863,12 @@ describe MergeRequest do
...
@@ -855,6 +863,12 @@ describe MergeRequest do
expect
(
subject
.
actual_head_pipeline
).
to
eq
(
subject
.
head_pipeline
)
expect
(
subject
.
actual_head_pipeline
).
to
eq
(
subject
.
head_pipeline
)
expect
(
subject
.
actual_head_pipeline
).
to
eq
(
pipeline
)
expect
(
subject
.
actual_head_pipeline
).
to
eq
(
pipeline
)
end
end
it
'returns nil when source project does not exist'
do
allow
(
subject
).
to
receive
(
:source_project
).
and_return
(
nil
)
expect
(
subject
.
actual_head_pipeline
).
to
be_nil
end
end
end
end
end
...
...
spec/presenters/merge_request_presenter_spec.rb
View file @
bac143ea
...
@@ -31,7 +31,7 @@ describe MergeRequestPresenter do
...
@@ -31,7 +31,7 @@ describe MergeRequestPresenter do
let
(
:pipeline
)
{
build_stubbed
(
:ci_pipeline
)
}
let
(
:pipeline
)
{
build_stubbed
(
:ci_pipeline
)
}
before
do
before
do
allow
(
resource
).
to
receive
(
:head_pipeline
).
and_return
(
pipeline
)
allow
(
resource
).
to
receive
(
:
actual_
head_pipeline
).
and_return
(
pipeline
)
end
end
context
'success with warnings'
do
context
'success with warnings'
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