Skip to content
Snippets Groups Projects
Commit 551ce0f2 authored by Robert Speicher's avatar Robert Speicher
Browse files

Add spec for assigning view param from cookie

parent 24f048be
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -200,15 +200,29 @@ describe Projects::MergeRequestsController do
end
 
describe 'GET diffs with view' do
def go(extra_params = {})
params = {
namespace_id: project.namespace.to_param,
project_id: project.to_param,
id: merge_request.iid
}
get :diffs, params.merge(extra_params)
end
it 'saves the preferred diff view in a cookie' do
get :diffs,
namespace_id: project.namespace.to_param,
project_id: project.to_param,
id: merge_request.iid,
view: 'parallel'
go view: 'parallel'
 
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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment