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:
Matt-Yorkley
2020-05-07 15:20:37 +02:00
parent 460ab6cdb4
commit 01d741509f

View File

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