From d5c9c53d8bca49d1706db4a9dab573f21c630e42 Mon Sep 17 00:00:00 2001 From: Mohamed ABDELLANI Date: Thu, 8 Dec 2022 08:32:11 +0100 Subject: [PATCH] fix the failing test --- .../order_cycle_customer_totals_report.csv | 3 +-- .../order_cycle_customer_totals_report_spec.rb | 10 +++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/spec/fixtures/reports/orders_and_fulfillment/order_cycle_customer_totals_report.csv b/spec/fixtures/reports/orders_and_fulfillment/order_cycle_customer_totals_report.csv index 1fffddd882..ef3fc83faa 100644 --- a/spec/fixtures/reports/orders_and_fulfillment/order_cycle_customer_totals_report.csv +++ b/spec/fixtures/reports/orders_and_fulfillment/order_cycle_customer_totals_report.csv @@ -1,3 +1,2 @@ Hub,Customer,Email,Phone,Producer,Product,Variant,Quantity,Item ($),Item + Fees ($),Admin & Handling ($),Ship ($),Pay fee ($),Total ($),Paid?,Shipping,Delivery?,Ship Street,Ship Street 2,Ship City,Ship Postcode,Ship State,Comments,SKU,Order Cycle,Payment Method,Customer Code,Tags,Billing Street,Billing Street 2,Billing City,Billing Postcode,Billing State,Order number,Date -Apple Market,John Doe,john@example.net,123-456-7890,Apple Farmer,Apples,"1g, S",1,10.0,10.0,"","","","",No,UPS Ground,Yes,10 Lovely Street,Northwest,Herndon,20170,Victoria,"",APP,"","",JHN,"",10 Lovely Street,Northwest,Herndon,20170,Victoria,R644360121,2022-05-26 00:00:00 -Apple Market,John Doe,"","","","","",TOTAL,10.0,10.0,0,0.0,0,10.0,No,"","","","","","","","","","","","","","","","","","",R644360121,2022-05-26 00:00:00 +Apple Market,John Doe,john@example.net,123-456-7890,Apple Farmer,Apples,"1g, S",1,10.0,10.0,"","","","",false,UPS Ground,true,10 Lovely Street,Northwest,Herndon,20170,Victoria,"",APP,,,JHN,"",10 Lovely Street,Northwest,Herndon,20170,Victoria,R644360121,2022-05-26 00:00:00 diff --git a/spec/lib/reports/orders_and_fulfillment/order_cycle_customer_totals_report_spec.rb b/spec/lib/reports/orders_and_fulfillment/order_cycle_customer_totals_report_spec.rb index 28b4a05625..d970d6c3d6 100644 --- a/spec/lib/reports/orders_and_fulfillment/order_cycle_customer_totals_report_spec.rb +++ b/spec/lib/reports/orders_and_fulfillment/order_cycle_customer_totals_report_spec.rb @@ -41,10 +41,14 @@ describe Reporting::Reports::OrdersAndFulfillment::OrderCycleCustomerTotals do "spec/fixtures/reports/orders_and_fulfillment/order_cycle_customer_totals_report.csv" end - it "generates the report" do - expect(report_table.length).to eq(2) + context 'csv format' do + let(:params) { { report_format: 'csv', display_summary_row: false, q: search_params } } - expect(report.render_as(:csv)).to eq comparison_report + it "generates the report" do + expect(report_table.length).to eq(1) + + expect(report.render_as(:csv)).to eq comparison_report + end end it "has a line item row" do