Commit 90d15e76 authored by Gary Holtz's avatar Gary Holtz

Adding a backend test for the feature flag

parent 11f5484f
......@@ -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
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment