Commit 8530ce4c authored by Robert Speicher's avatar Robert Speicher

Clarify that the diff view setting always comes from the cookie

This invalidates one test, which we've removed.
parent 90a67a76
...@@ -83,8 +83,7 @@ class Projects::ApplicationController < ApplicationController ...@@ -83,8 +83,7 @@ class Projects::ApplicationController < ApplicationController
end end
def apply_diff_view_cookie! def apply_diff_view_cookie!
view = params[:view] || cookies[:diff_view] cookies.permanent[:diff_view] = params.delete(:view) if params[:view].present?
cookies.permanent[:diff_view] = params[:view] = view if view
end end
def builds_enabled def builds_enabled
......
...@@ -300,14 +300,6 @@ describe Projects::MergeRequestsController do ...@@ -300,14 +300,6 @@ describe Projects::MergeRequestsController do
expect(response.cookies['diff_view']).to eq('parallel') expect(response.cookies['diff_view']).to eq('parallel')
end end
it 'assigns :view param based on cookie' do
request.cookies['diff_view'] = 'parallel'
go
expect(controller.params[:view]).to eq 'parallel'
end
end end
describe 'GET commits' do describe 'GET commits' do
......
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