mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Add Variant#default_price test coverage for soft-deletion
This commit is contained in:
@@ -742,4 +742,21 @@ module Spree
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
describe "#default_price" do
|
||||
let(:variant) { create(:variant) }
|
||||
let(:default_price) { variant.default_price }
|
||||
|
||||
context "when the default price is soft-deleted" do
|
||||
it "can access the default price" do
|
||||
price_id = default_price.id
|
||||
|
||||
default_price.destroy
|
||||
|
||||
expect(variant.reload.default_price).to be_a Spree::Price
|
||||
expect(variant.default_price.id).to eq price_id
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user