From d1209dd49bd198ef0711a25504f2e2c4f63f619c Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Mon, 3 Jul 2023 17:23:48 +0100 Subject: [PATCH] Update order_with_taxes factory --- spec/factories/order_factory.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/spec/factories/order_factory.rb b/spec/factories/order_factory.rb index 979b820044..0bf4e1b73b 100644 --- a/spec/factories/order_factory.rb +++ b/spec/factories/order_factory.rb @@ -192,12 +192,13 @@ FactoryBot.define do after(:create) do |order, proxy| order.distributor.update_attribute(:charges_sales_tax, true) - product = FactoryBot.create(:taxed_product, zone: proxy.zone, - price: proxy.product_price, - tax_rate_amount: proxy.tax_rate_amount, - tax_rate_name: proxy.tax_rate_name, - included_in_price: proxy.included_in_price) - FactoryBot.create(:line_item, order: order, product: product, price: product.price) + product = create(:taxed_product, zone: proxy.zone, + price: proxy.product_price, + tax_rate_amount: proxy.tax_rate_amount, + tax_rate_name: proxy.tax_rate_name, + included_in_price: proxy.included_in_price) + + create(:line_item, order: order, variant: product.variants.first, price: product.price) order.reload end end