From 8b146fc72ad0d1b30b0c123dead8fa5e8923748b Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Sat, 30 Jul 2022 16:13:18 +0100 Subject: [PATCH] Adds included_in_price trait on broken specs --- spec/system/admin/order_spec.rb | 2 +- spec/system/admin/reports_spec.rb | 9 +++++++-- spec/system/consumer/shopping/cart_spec.rb | 2 +- spec/system/consumer/shopping/checkout_spec.rb | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/spec/system/admin/order_spec.rb b/spec/system/admin/order_spec.rb index c206280d6d..bc68f00ac6 100644 --- a/spec/system/admin/order_spec.rb +++ b/spec/system/admin/order_spec.rb @@ -424,7 +424,7 @@ describe ' end let!(:order) do create(:order_with_taxes, distributor: distributor1, ship_address: create(:address), - product_price: 110, tax_rate_amount: 0.1, + product_price: 110, tax_rate_amount: 0.1, included_in_price: true, tax_rate_name: "Tax 1").tap do |order| order.create_tax_charge! order.update_shipping_fees! diff --git a/spec/system/admin/reports_spec.rb b/spec/system/admin/reports_spec.rb index 3be7e224cd..0313861310 100644 --- a/spec/system/admin/reports_spec.rb +++ b/spec/system/admin/reports_spec.rb @@ -208,8 +208,13 @@ describe ' create(:order, order_cycle: order_cycle, distributor: user1.enterprises.first, ship_address: address, bill_address: address) } - let(:product1) { create(:taxed_product, zone: zone, price: 12.54, tax_rate_amount: 0) } - let(:product2) { create(:taxed_product, zone: zone, price: 500.15, tax_rate_amount: 0.2) } + let(:product1) { + create(:taxed_product, zone: zone, price: 12.54, tax_rate_amount: 0, included_in_price: true) + } + let(:product2) { + create(:taxed_product, zone: zone, price: 500.15, tax_rate_amount: 0.2, + included_in_price: true) + } let!(:line_item1) { create(:line_item, variant: product1.variants.first, price: 12.54, quantity: 1, order: order1) diff --git a/spec/system/consumer/shopping/cart_spec.rb b/spec/system/consumer/shopping/cart_spec.rb index e08ecb2564..e8caa48392 100644 --- a/spec/system/consumer/shopping/cart_spec.rb +++ b/spec/system/consumer/shopping/cart_spec.rb @@ -22,7 +22,7 @@ describe "full-page cart", js: true do create(:enterprise_fee, amount: 11.00, tax_category: product_with_tax.tax_category) } let(:product_with_tax) { - create(:taxed_product, supplier: supplier, zone: zone, price: 110.00, tax_rate_amount: 0.1) + create(:taxed_product, supplier: supplier, zone: zone, price: 110.00, tax_rate_amount: 0.1, included_in_price: true) } let(:product_with_fee) { create(:simple_product, supplier: supplier, price: 0.86, on_hand: 100) diff --git a/spec/system/consumer/shopping/checkout_spec.rb b/spec/system/consumer/shopping/checkout_spec.rb index 22e8b4e623..04015ae715 100644 --- a/spec/system/consumer/shopping/checkout_spec.rb +++ b/spec/system/consumer/shopping/checkout_spec.rb @@ -21,7 +21,7 @@ describe "As a consumer I want to check out my cart", js: true do let(:fee_tax_rate) { create(:tax_rate, amount: 0.10, zone: zone, included_in_price: true) } let(:fee_tax_category) { create(:tax_category, tax_rates: [fee_tax_rate]) } let(:product) { - create(:taxed_product, supplier: supplier, price: 10, zone: zone, tax_rate_amount: 0.1) + create(:taxed_product, supplier: supplier, price: 10, zone: zone, tax_rate_amount: 0.1, included_in_price: true) } let(:variant) { product.variants.first } let(:order) {