Skip to content

Commit

Permalink
Test for differences in path generation between Rails 5 & 6
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Oct 3, 2019
1 parent dc71383 commit d4e54d1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spec/views/catalog/_show_tools.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
let(:document_actions) { blacklight_config.show.document_actions }

it "renders a document action" do
allow(view).to receive(:some_action_solr_document_path).with(document).and_return "x"
if Rails.version < '6.0.0'
allow(view).to receive(:some_action_solr_document_path).with(document).and_return "x"
else
allow(view).to receive(:some_action_solr_document_path).with(document, only_path: true).and_return "x"
end
document_actions[:some_action] = Blacklight::Configuration::ToolConfig.new partial: 'document_action'
render partial: 'catalog/show_tools'
expect(rendered).to have_link "Some action", href: "x"
Expand Down

0 comments on commit d4e54d1

Please sign in to comment.