From d119ec617ea9b25513236cb01faea4103773f3ef Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Fri, 16 Feb 2024 07:01:36 +0800 Subject: [PATCH] DEV: Disable `BlockRequestsMiddleware` before every test (#25712) Why this change? This is a follow up to c30aeafd9db40bfbd848430359285547a1b1f605. The commit was calling `BlockRequestsMiddleware.allow_requests!` only before `type: :system` tests but non system type tests could be running as well and needs the `BlockRequestsMiddleware.allow_requests!` middleware to be disabled too. --- spec/rails_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index dbf92bd38a4..c34c465bb14 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -151,6 +151,7 @@ module TestSetup OmniAuth.config.test_mode = false Middleware::AnonymousCache.disable_anon_cache + BlockRequestsMiddleware.allow_requests! end end @@ -608,7 +609,6 @@ RSpec.configure do |config| driven_by driver.join("_").to_sym setup_system_test - BlockRequestsMiddleware.allow_requests! end config.after(:each, type: :system) do |example|