Refresh products cache when a variant override is destroyed

This commit is contained in:
Rohan Mitchell
2016-01-29 10:16:41 +11:00
parent b7a88fd03b
commit 1ec329284c
2 changed files with 11 additions and 0 deletions

View File

@@ -36,6 +36,7 @@ module OpenFoodNetwork
def self.variant_override_destroyed(variant_override)
variant_override_changed variant_override
end

View File

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