From 62739c04584d7bb2bdb5bd0eb0aed3847fc6fdec Mon Sep 17 00:00:00 2001 From: cyrillefr Date: Wed, 28 Feb 2024 10:00:31 +0100 Subject: [PATCH] Requested changes in spec - use of new service instead of manually advancing an order --- .../sales_tax_totals_by_producer_spec.rb | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/spec/system/admin/reports/sales_tax/sales_tax_totals_by_producer_spec.rb b/spec/system/admin/reports/sales_tax/sales_tax_totals_by_producer_spec.rb index c602bb8981..f36ccdde08 100644 --- a/spec/system/admin/reports/sales_tax/sales_tax_totals_by_producer_spec.rb +++ b/spec/system/admin/reports/sales_tax/sales_tax_totals_by_producer_spec.rb @@ -70,9 +70,7 @@ describe "Sales Tax Totals By Producer" do ship_address_id: ship_address.id }) - while !order.completed? - break unless order.next! - end + OrderWorkflow.new(order).complete! end it "generates the report" do @@ -130,9 +128,7 @@ describe "Sales Tax Totals By Producer" do ship_address_id: ship_address.id }) - while !order.completed? - break unless order.next! - end + OrderWorkflow.new(order).complete! end it 'generates the report' do @@ -191,9 +187,7 @@ describe "Sales Tax Totals By Producer" do ship_address_id: ship_address.id }) - while !order.completed? - break unless order.next! - end + OrderWorkflow.new(order).complete! end it "generates the report" do login_as admin @@ -369,9 +363,7 @@ describe "Sales Tax Totals By Producer" do ship_address_id: customer1.bill_address_id, customer_id: customer1.id }) - while !order.completed? - break unless order.next! - end + OrderWorkflow.new(order).complete! order2.line_items.create({ variant:, quantity: 1, price: 200 }) order2.update!({ @@ -379,9 +371,7 @@ describe "Sales Tax Totals By Producer" do ship_address_id: customer2.bill_address_id, customer_id: customer2.id }) - while !order2.completed? - break unless order2.next! - end + OrderWorkflow.new(order2).complete! login_as admin visit admin_reports_path click_on 'Sales Tax Totals By Producer'