From 598f69f42f3fbbbaa0c4dcfd3e6ef1c6cb6ac4dd Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Thu, 15 Jun 2023 11:28:01 +0100 Subject: [PATCH] Clears cache around examples for specs testing cache --- spec/system/consumer/caching/darkswarm_caching_spec.rb | 5 +++++ spec/system/consumer/caching/shops_caching_spec.rb | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/spec/system/consumer/caching/darkswarm_caching_spec.rb b/spec/system/consumer/caching/darkswarm_caching_spec.rb index 0cf866ce44..2d4247f051 100644 --- a/spec/system/consumer/caching/darkswarm_caching_spec.rb +++ b/spec/system/consumer/caching/darkswarm_caching_spec.rb @@ -19,6 +19,11 @@ describe "Darkswarm data caching", caching: true do } let(:exchange) { order_cycle.exchanges.outgoing.where(receiver_id: distributor.id).first } + around do |example| + Rails.cache.clear + example.run + end + before do exchange.variants << product.variants.first end diff --git a/spec/system/consumer/caching/shops_caching_spec.rb b/spec/system/consumer/caching/shops_caching_spec.rb index f1793f636b..53d876267f 100644 --- a/spec/system/consumer/caching/shops_caching_spec.rb +++ b/spec/system/consumer/caching/shops_caching_spec.rb @@ -13,6 +13,11 @@ describe "Shops caching", caching: true do create(:open_order_cycle, distributors: [distributor], coordinator: distributor) } + around do |example| + Rails.cache.clear + example.run + end + describe "caching enterprises AMS data" do it "caches data for all enterprises, with the provided options" do visit shops_path