Skip to content

Commit

Permalink
ActionController::RoutingError is rescued in Rails 7.2
Browse files Browse the repository at this point in the history
Still, it's better to assert on http code rather than custom framework
error in such acceptance test.
  • Loading branch information
fidel committed Jan 18, 2025
1 parent 12b2fed commit 7bfa25e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions contrib/dres_rails/spec/features/expose_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ class MyEvent < RubyEventStore::Event

specify "Auth" do
page.driver.header "RES-Api-Key", "Wrong"
expect { visit "/dres_rails" }.to raise_error(ActionController::RoutingError)
visit "/dres_rails"
expect(page.status_code).to eq(404)

page.driver.header "RES-Api-Key", "33bbd0ea-b7ce-49d5-bc9d-198f7884c485"
expect { visit "/dres_rails" }.not_to raise_error
visit "/dres_rails"
expect(page.status_code).to eq(200)
end

specify "returns JSON with serialized events" do
Expand Down

0 comments on commit 7bfa25e

Please sign in to comment.