diff --git a/spec/factories/order_factory.rb b/spec/factories/order_factory.rb index 28abe6dd09..f9c5ecb941 100644 --- a/spec/factories/order_factory.rb +++ b/spec/factories/order_factory.rb @@ -141,15 +141,16 @@ FactoryBot.define do factory :order_with_totals_and_distribution, parent: :order_with_distributor do transient do shipping_fee { 3 } + product { variant&.product || create(:simple_product) } + variant { product.variants.first } end order_cycle { create(:simple_order_cycle) } after(:create) do |order, proxy| - product = create(:simple_product) create(:line_item_with_shipment, shipping_fee: proxy.shipping_fee, order:, - product:) + variant: proxy.variant) order.reload end