Files
fizzy/test/test_helpers/caching_test_helper.rb
Mike Dalessio abe48f0efa Ensure user toggles on board edit page are cached properly
Not including the disabled flag as part of the cache resulted in
issues like the one described in #1992
2025-12-08 14:21:56 -05:00

15 lines
521 B
Ruby

module CachingTestHelper
def with_actionview_partial_caching
was_cache = ActionView::PartialRenderer.collection_cache
was_perform_caching = ApplicationController.perform_caching
begin
ActionView::PartialRenderer.collection_cache = ActiveSupport::Cache.lookup_store(:memory_store)
ApplicationController.perform_caching = true
yield
ensure
ActionView::PartialRenderer.collection_cache = was_cache
ApplicationController.perform_caching = was_perform_caching
end
end
end