Fix rebase issue

Fix test by creating a variant instead of relying on some random data
from the database.
This commit is contained in:
Gaetan Craig-Riou
2024-06-26 12:03:49 +10:00
parent 1d86315108
commit 1ead9208ee

View File

@@ -136,7 +136,9 @@ end
RSpec.shared_examples "associated attribute changes - line items" do |boolean, type|
context "line item changes" do
let(:line_item){ order.line_items.first }
let(:line_item) { order.line_items.first }
let(:variant) { create(:variant) }
context "on quantitity" do
before { line_item.update!(quantity: line_item.quantity + 1) }
it "returns #{boolean} if a #{type} attribute changes" do
@@ -146,7 +148,7 @@ RSpec.shared_examples "associated attribute changes - line items" do |boolean, t
end
context "on variant id" do
before { line_item.update!(variant_id: Spree::Variant.first.id) }
before { line_item.update!(variant_id: variant.id) }
it "returns #{boolean} if a #{type} attribute changes" do
order.reload
expect(subject).to be boolean