Ensure all assets are compiled on test page visit

This commit is contained in:
Maikel Linke
2024-06-19 11:45:28 +10:00
parent 1e189207ed
commit d5b77a4f80

View File

@@ -14,12 +14,13 @@ RSpec.describe "Shops caching", caching: true do
}
describe "caching enterprises AMS data" do
it "caches data for all enterprises, with the provided options" do
before do
# Trigger lengthy tasks like JS compilation before testing caching:
visit shops_path
Rails.cache.clear
end
# Now run the test, hopefully in a timely manner:
it "caches data for all enterprises, with the provided options" do
visit shops_path
key, options = CacheService::FragmentCaching.ams_shops
@@ -73,6 +74,10 @@ RSpec.describe "Shops caching", caching: true do
before do
exchange.variants << product.variants.first
# Trigger lengthy tasks like JS compilation before testing caching:
visit enterprise_shop_path(distributor)
Rails.cache.clear
end
it "caches rendered response for taxons and properties, with the provided options" do