mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-13 04:00:21 +00:00
Update Fragment Caching for Rails 4
Rails 4 introduced "automagically" modified cache keys, that included a digest in the key on any cache entry related to views. This is not what we want at all, fixed here with the `skip_digest: true` option.
This commit is contained in:
@@ -33,10 +33,10 @@ feature "Darkswarm data caching", js: true, caching: true do
|
||||
visit shops_path
|
||||
|
||||
taxon_timestamp1 = CacheService.latest_timestamp_by_class(Spree::Taxon)
|
||||
expect_cached "views/#{CacheService::FragmentCaching.ams_all_taxons_key}"
|
||||
expect_cached "views/#{CacheService::FragmentCaching.ams_all_taxons[0]}"
|
||||
|
||||
property_timestamp1 = CacheService.latest_timestamp_by_class(Spree::Property)
|
||||
expect_cached "views/#{CacheService::FragmentCaching.ams_all_properties_key}"
|
||||
expect_cached "views/#{CacheService::FragmentCaching.ams_all_properties[0]}"
|
||||
|
||||
toggle_filters
|
||||
|
||||
@@ -54,10 +54,10 @@ feature "Darkswarm data caching", js: true, caching: true do
|
||||
visit shops_path
|
||||
|
||||
taxon_timestamp2 = CacheService.latest_timestamp_by_class(Spree::Taxon)
|
||||
expect_cached "views/#{CacheService::FragmentCaching.ams_all_taxons_key}"
|
||||
expect_cached "views/#{CacheService::FragmentCaching.ams_all_taxons[0]}"
|
||||
|
||||
property_timestamp2 = CacheService.latest_timestamp_by_class(Spree::Property)
|
||||
expect_cached "views/#{CacheService::FragmentCaching.ams_all_properties_key}"
|
||||
expect_cached "views/#{CacheService::FragmentCaching.ams_all_properties[0]}"
|
||||
|
||||
expect(taxon_timestamp1).to_not eq taxon_timestamp2
|
||||
expect(property_timestamp1).to_not eq property_timestamp2
|
||||
|
||||
Reference in New Issue
Block a user