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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
c7db9929
Commit
c7db9929
authored
Oct 05, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass current_user to pipeline presenter
parent
e55b3da4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
ee/app/serializers/ee/merge_request_widget_entity.rb
ee/app/serializers/ee/merge_request_widget_entity.rb
+7
-7
ee/spec/serializers/merge_request_widget_entity_spec.rb
ee/spec/serializers/merge_request_widget_entity_spec.rb
+1
-2
No files found.
ee/app/serializers/ee/merge_request_widget_entity.rb
View file @
c7db9929
...
...
@@ -16,13 +16,13 @@ module EE
end
end
expose
:codeclimate
,
if:
->
(
mr
,
_
)
{
head_pipeline_downloadable_url_for_report_type
(
mr
,
:codequality
)
}
do
expose
:codeclimate
,
if:
->
(
mr
,
_
)
{
head_pipeline_downloadable_url_for_report_type
(
:codequality
)
}
do
expose
:head_path
do
|
merge_request
|
head_pipeline_downloadable_url_for_report_type
(
merge_request
,
:codequality
)
head_pipeline_downloadable_url_for_report_type
(
:codequality
)
end
expose
:base_path
do
|
merge_request
|
base_pipeline_downloadable_url_for_report_type
(
merge_request
,
:codequality
)
base_pipeline_downloadable_url_for_report_type
(
:codequality
)
end
end
...
...
@@ -170,12 +170,12 @@ module EE
private
def
head_pipeline_downloadable_url_for_report_type
(
merge_request
,
file_type
)
merge_request
.
head_pipeline
&
.
present
&
.
downloadable_url_for_report_type
(
file_type
)
def
head_pipeline_downloadable_url_for_report_type
(
file_type
)
object
.
head_pipeline
&
.
present
(
current_user:
current_user
)
&
.
downloadable_url_for_report_type
(
file_type
)
end
def
base_pipeline_downloadable_url_for_report_type
(
merge_request
,
file_type
)
merge_request
.
base_pipeline
&
.
present
&
.
downloadable_url_for_report_type
(
file_type
)
def
base_pipeline_downloadable_url_for_report_type
(
file_type
)
object
.
base_pipeline
&
.
present
(
current_user:
current_user
)
&
.
downloadable_url_for_report_type
(
file_type
)
end
end
end
ee/spec/serializers/merge_request_widget_entity_spec.rb
View file @
c7db9929
...
...
@@ -12,7 +12,7 @@ describe MergeRequestWidgetEntity do
end
subject
do
described_class
.
new
(
merge_request
,
request:
request
)
described_class
.
new
(
merge_request
,
current_user:
user
,
request:
request
)
end
it
'has blob path data'
do
...
...
@@ -32,7 +32,6 @@ describe MergeRequestWidgetEntity do
base_pipeline:
pipeline
,
head_pipeline:
pipeline
)
allow_any_instance_of
(
Ci
::
PipelinePresenter
).
to
receive
(
:current_user
).
and_return
(
user
)
end
context
'with codeclimate data'
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