mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-09 03:20:21 +00:00
Refresh products cache when a variant override is destroyed
This commit is contained in:
@@ -36,6 +36,7 @@ module OpenFoodNetwork
|
||||
|
||||
|
||||
def self.variant_override_destroyed(variant_override)
|
||||
variant_override_changed variant_override
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -108,6 +108,16 @@ module OpenFoodNetwork
|
||||
end
|
||||
|
||||
|
||||
describe "when a variant override is destroyed" do
|
||||
let(:vo) { double(:variant_override) }
|
||||
|
||||
it "performs the same refresh as a variant override change" do
|
||||
expect(ProductsCache).to receive(:variant_override_changed).with(vo)
|
||||
ProductsCache.variant_override_destroyed vo
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
describe "refreshing the cache" do
|
||||
let(:distributor) { double(:distributor, id: 123) }
|
||||
let(:order_cycle) { double(:order_cycle, id: 456) }
|
||||
|
||||
Reference in New Issue
Block a user