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
90d15e76
Commit
90d15e76
authored
Sep 10, 2020
by
Gary Holtz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding a backend test for the feature flag
parent
11f5484f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+1
-1
spec/controllers/projects/merge_requests_controller_spec.rb
spec/controllers/projects/merge_requests_controller_spec.rb
+16
-0
No files found.
app/controllers/projects/merge_requests_controller.rb
View file @
90d15e76
...
...
@@ -452,7 +452,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
params
=
request
.
query_parameters
params
[
:view
]
=
cookies
[
:diff_view
]
if
params
[
:view
].
blank?
&&
cookies
[
:diff_view
].
present?
if
Feature
.
enabled?
(
:default_merge_ref_for_diffs
,
@
project
)
if
Feature
.
enabled?
(
:default_merge_ref_for_diffs
,
project
)
params
=
params
.
merge
(
diff_head:
true
)
end
...
...
spec/controllers/projects/merge_requests_controller_spec.rb
View file @
90d15e76
...
...
@@ -87,6 +87,22 @@ RSpec.describe Projects::MergeRequestsController do
end
end
context
'with `default_merge_ref_for_diffs` feature flag enabled'
do
before
do
stub_feature_flags
(
default_merge_ref_for_diffs:
true
)
go
end
it
'adds the diff_head parameter'
do
expect
(
assigns
[
"endpoint_metadata_url"
]).
to
eq
(
diffs_metadata_project_json_merge_request_path
(
project
,
merge_request
,
'json'
,
diff_head:
true
))
end
end
context
'when diff is missing'
do
render_views
...
...
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