From e8529754f13865247c7124a465f1e10a8f6f9232 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Fri, 29 Jul 2022 19:56:56 +0100 Subject: [PATCH] Updates order and product factory to consider added tax --- spec/factories/order_factory.rb | 4 +++- spec/factories/product_factory.rb | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/spec/factories/order_factory.rb b/spec/factories/order_factory.rb index 2baa4bc92a..6f38184372 100644 --- a/spec/factories/order_factory.rb +++ b/spec/factories/order_factory.rb @@ -182,6 +182,7 @@ FactoryBot.define do product_price { 0 } tax_rate_amount { 0 } tax_rate_name { "" } + included_in_price { "" } zone { create(:zone_with_member) } end @@ -193,7 +194,8 @@ FactoryBot.define do 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) + 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) order.reload end diff --git a/spec/factories/product_factory.rb b/spec/factories/product_factory.rb index 0e6108bb4a..24ff5cf531 100644 --- a/spec/factories/product_factory.rb +++ b/spec/factories/product_factory.rb @@ -67,6 +67,7 @@ FactoryBot.define do transient do tax_rate_amount { 0 } tax_rate_name { "" } + included_in_price { "" } zone { nil } end @@ -77,7 +78,7 @@ FactoryBot.define do create(:tax_rate, amount: proxy.tax_rate_amount, tax_category: product.tax_category, - included_in_price: true, + included_in_price: proxy.included_in_price, calculator: Calculator::DefaultTax.new, zone: proxy.zone, name: proxy.tax_rate_name)