mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Test that variants or overrides are actually reset
This commit is contained in:
@@ -96,6 +96,14 @@ describe ProductImport::ResetAbsent do
|
||||
it 'returns the number of products reset' do
|
||||
expect(reset_absent.call).to eq(2)
|
||||
end
|
||||
|
||||
it 'resets the products of the specified suppliers' do
|
||||
suppliers_to_reset_products = reset_absent
|
||||
.instance_variable_get('@suppliers_to_reset_products')
|
||||
|
||||
reset_absent.call
|
||||
expect(suppliers_to_reset_products).to eq([enterprise.id])
|
||||
end
|
||||
end
|
||||
|
||||
context 'and importing into inventory' do
|
||||
@@ -120,6 +128,14 @@ describe ProductImport::ResetAbsent do
|
||||
it 'returns nil' do
|
||||
expect(reset_absent.call).to be_nil
|
||||
end
|
||||
|
||||
it 'resets the inventories of the specified suppliers' do
|
||||
suppliers_to_reset_inventories = reset_absent
|
||||
.instance_variable_get('@suppliers_to_reset_inventories')
|
||||
|
||||
reset_absent.call
|
||||
expect(suppliers_to_reset_inventories).to eq([enterprise.id])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user