if block_given?
yield text, parameters, options
else
- link_to text, params.merge(parameters), options
+ link_to text, {:params => request.query_parameters.merge(parameters)}, options
end
end
end
end
end
- def test_pagination_links_on_index_without_project_id_in_url
+ def test_pagination_links_should_preserve_query_parameters
with_settings :per_page_options => '2' do
- get '/issues', :project_id => 'ecookbook'
-
- assert_select 'a[href=?]', '/projects/ecookbook/issues?page=2', :text => '2'
+ get '/projects/ecookbook/issues?foo=bar'
+
+ assert_select 'a[href=?]', '/projects/ecookbook/issues?foo=bar&page=2', :text => '2'
end
end