mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Add a soft-deleted test in line_item_spec
This commit is contained in:
@@ -585,5 +585,17 @@ module Spree
|
||||
}.to change(Spree::OptionValue, :count).by(0)
|
||||
end
|
||||
end
|
||||
|
||||
describe "when the associated variant is soft-deleted" do
|
||||
let!(:variant) { create(:variant) }
|
||||
let!(:line_item) { create(:line_item, variant: variant) }
|
||||
|
||||
it "returns the associated variant or product" do
|
||||
line_item.variant.delete
|
||||
|
||||
expect(line_item.variant).to eq variant
|
||||
expect(line_item.product).to eq variant.product
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user