Allow running specs scenarios using the Rails cache

Cache is by default disabled on every non-production environment
This commit is contained in:
Julian Herrero
2024-03-28 13:45:06 +01:00
committed by Javi Martín
parent 62cd4c8d7b
commit f30fa29994

View File

@@ -193,6 +193,11 @@ RSpec.configure do |config|
savon.unmock! savon.unmock!
end end
config.before(:each, :with_cache) do
allow(Rails).to receive(:cache).and_return(ActiveSupport::Cache.lookup_store(:memory_store))
Rails.cache.clear
end
# Allows RSpec to persist some state between runs in order to support # Allows RSpec to persist some state between runs in order to support
# the `--only-failures` and `--next-failure` CLI options. # the `--only-failures` and `--next-failure` CLI options.
config.example_status_persistence_file_path = "spec/examples.txt" config.example_status_persistence_file_path = "spec/examples.txt"