mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Fix test of rendered properties AMS
Here the displayed properties that we're testing also rely on shops data (including the list of supplied properties), which is now cached for 15 seconds. We clear that cache entry so we can cleanly test only the caching of the properties AMS array.
This commit is contained in:
@@ -50,6 +50,9 @@ feature "Darkswarm data caching", js: true, caching: true do
|
||||
property.presentation = "Changed Property"
|
||||
property.save
|
||||
|
||||
# Clear timed shops cache so we can test uncached supplied properties
|
||||
clear_shops_cache
|
||||
|
||||
visit shops_path
|
||||
|
||||
taxon_timestamp2 = CacheService.latest_timestamp_by_class(Spree::Taxon)
|
||||
@@ -73,4 +76,9 @@ feature "Darkswarm data caching", js: true, caching: true do
|
||||
def expect_cached(key)
|
||||
expect(Rails.cache.exist?(key)).to be true
|
||||
end
|
||||
|
||||
def clear_shops_cache
|
||||
cache_key = "views/#{CacheService::FragmentCaching.ams_shops[0]}"
|
||||
Rails.cache.delete cache_key
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user