Skip to content

Commit

Permalink
Fix #search_action_url for Rails 5 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Sep 1, 2016
1 parent d914c53 commit 8f63bd5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions app/controllers/concerns/blacklight/catalog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,6 @@ def render_document_export_format format_name
# By default, any search action from a Blacklight::Catalog controller
# should use the current controller when constructing the route.
def search_action_url options = {}
raise ArgumentError, "Options was not a hash (#{options.class}" unless options.is_a? Hash
# We don't want to permit here because one of the options could be :only_path, which is an option, but not a parameter
# options.permit!
url_for(options.merge(action: 'index'))
end

Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/catalog_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ def export_as_mock
describe "search_action_url" do
it "is the same as the catalog url" do
get :index, params: { page: 1 }
expect(controller.send(:search_action_url, q: "xyz")).to eq root_url(q: "xyz")
expect(controller.send(:search_action_url, ActionController::Parameters.new(q: "xyz"))).to eq root_url(q: "xyz")
end
end

Expand Down

0 comments on commit 8f63bd5

Please sign in to comment.