From 8a69d7c5837c0e300d3bf3396f63ca335afac1df Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sat, 20 Aug 2022 22:02:22 +0200 Subject: [PATCH] Adjust `fails to access route` spec for role-constrained routes --- spec/integration/role_constrained_routes_spec.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/integration/role_constrained_routes_spec.rb b/spec/integration/role_constrained_routes_spec.rb index b4072840..acc802eb 100644 --- a/spec/integration/role_constrained_routes_spec.rb +++ b/spec/integration/role_constrained_routes_spec.rb @@ -8,7 +8,8 @@ describe "role-constrained routes", type: :request do it "fails to access route" do # 302 = redirect to login # 404 = no user found -- we have a fallback route if something could not be matched - expect(subject).to be_in [302, 404] + result = begin; subject; rescue ActionController::RoutingError; :no_route; end + expect(result).to be_in [302, 404, :no_route] end end