From 21ddb961335fae7bca2197df6156520de3fcc1f4 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Tue, 25 Jul 2023 14:33:39 +1200 Subject: [PATCH] Optional Rails.cache reset before each test. --- spec/spec_helper.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 4ab8a1b0..dfcd2ef7 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -5,7 +5,6 @@ require "minitest/autorun" require "minitest/pride" require "rack/test" -# require "rails" require "active_support" require "rack/attack" @@ -28,11 +27,11 @@ def safe_require(name) class MiniTest::Spec include Rack::Test::Methods - # if Object.const_defined?(:Rails) - # before do - # Rails.cache = nil - # end - # end + before do + if Object.const_defined?(:Rails) + Rails.cache = nil + end + end after do Rack::Attack.clear_configuration