From 7bfa25e15f7de6ea849b9bc6597064ea600344c7 Mon Sep 17 00:00:00 2001 From: Szymon Fiedler Date: Sat, 18 Jan 2025 14:46:57 +0100 Subject: [PATCH] ActionController::RoutingError is rescued in Rails 7.2 Still, it's better to assert on http code rather than custom framework error in such acceptance test. --- contrib/dres_rails/spec/features/expose_spec.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/dres_rails/spec/features/expose_spec.rb b/contrib/dres_rails/spec/features/expose_spec.rb index f2e92fb953..0d42b5f821 100644 --- a/contrib/dres_rails/spec/features/expose_spec.rb +++ b/contrib/dres_rails/spec/features/expose_spec.rb @@ -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