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:
Matt-Yorkley
2020-05-22 13:44:27 +02:00
parent a9abe48ede
commit b00fbd69ae
3 changed files with 18 additions and 12 deletions

View File

@@ -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