#rails #minitest #testing
Add to test/test_helper.rb
def with_cache
@original_cache_store = Rails.cache
Rails.cache = ActiveSupport::Cache::MemoryStore.new
yield
ensure
Rails.cache = @original_cache_store
end
#rails #minitest #testing
Add to test/test_helper.rb
def with_cache
@original_cache_store = Rails.cache
Rails.cache = ActiveSupport::Cache::MemoryStore.new
yield
ensure
Rails.cache = @original_cache_store
end