Clarify that the diff view setting always comes from the cookie

This invalidates one test, which we've removed.
This commit is contained in:
Robert Speicher 2016-04-18 14:13:38 -04:00
parent 90a67a76d5
commit 8530ce4c6f
2 changed files with 1 additions and 10 deletions

View File

@ -83,8 +83,7 @@ class Projects::ApplicationController < ApplicationController
end
def apply_diff_view_cookie!
view = params[:view] || cookies[:diff_view]
cookies.permanent[:diff_view] = params[:view] = view if view
cookies.permanent[:diff_view] = params.delete(:view) if params[:view].present?
end
def builds_enabled

View File

@ -300,14 +300,6 @@ describe Projects::MergeRequestsController do
expect(response.cookies['diff_view']).to eq('parallel')
end
it 'assigns :view param based on cookie' do
request.cookies['diff_view'] = 'parallel'
go
expect(controller.params[:view]).to eq 'parallel'
end
end
describe 'GET commits' do