2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-11-24 14:40:05 +01:00
|
|
|
RSpec.configure do |config|
|
2023-12-01 13:38:38 +01:00
|
|
|
config.around(:example, :caching) do |example|
|
2023-11-24 14:40:05 +01:00
|
|
|
caching_was = ActionController::Base.perform_caching
|
|
|
|
cache_store_was = Rails.cache
|
|
|
|
|
|
|
|
Rails.cache = ActiveSupport::Cache::MemoryStore.new
|
|
|
|
ActionController::Base.perform_caching = true
|
|
|
|
ActionController::Base.cache_store = Rails.cache
|
|
|
|
|
|
|
|
example.run
|
|
|
|
ensure
|
|
|
|
Rails.cache = cache_store_was
|
|
|
|
ActionController::Base.perform_caching = caching_was
|
|
|
|
ActionController::Base.cache_store = Rails.cache
|
|
|
|
end
|
|
|
|
end
|