From 95ed8063705b1cbff4bccfcf495d065014188fb4 Mon Sep 17 00:00:00 2001 From: Gaetan Craig-Riou Date: Tue, 5 Mar 2024 10:33:50 +1100 Subject: [PATCH] Fix shipment specs --- spec/models/spree/shipment_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/models/spree/shipment_spec.rb b/spec/models/spree/shipment_spec.rb index 4b4f70318c..a559d8b855 100644 --- a/spec/models/spree/shipment_spec.rb +++ b/spec/models/spree/shipment_spec.rb @@ -65,8 +65,8 @@ RSpec.describe Spree::Shipment do end describe "with soft-deleted products or variants" do - let!(:product) { create(:product) } - let!(:order) { create(:order, distributor: product.supplier) } + let(:variant) { create(:variant) } + let(:order) { create(:order, distributor: variant.supplier) } context "when the variant is soft-deleted" do it "can still access the variant" do @@ -79,7 +79,7 @@ RSpec.describe Spree::Shipment do context "when the product is soft-deleted" do it "can still access the variant" do - order.line_items.first.variant.delete + order.line_items.first.product.delete variants = shipment.reload.manifest.map(&:variant) expect(variants).to eq [order.line_items.first.variant]