Clears cache around examples

for specs testing cache
This commit is contained in:
filipefurtad0
2023-06-15 11:28:01 +01:00
parent 701fef84f3
commit 598f69f42f
2 changed files with 10 additions and 0 deletions

View File

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

View File

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