From 3227922c7670b3f142a0dd79e0c464564ba7f0ea Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 16 Oct 2024 16:18:23 +1100 Subject: [PATCH] Use reports helper to DRY --- .../admin/reports/customers_report_spec.rb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/spec/system/admin/reports/customers_report_spec.rb b/spec/system/admin/reports/customers_report_spec.rb index 7f5caaab46..a9fc0746c8 100644 --- a/spec/system/admin/reports/customers_report_spec.rb +++ b/spec/system/admin/reports/customers_report_spec.rb @@ -14,12 +14,14 @@ RSpec.describe "Customers report" do end run_report - rows = find("table.report__table").all("thead tr") - table = rows.map { |r| r.all("th").map { |c| c.text.strip } } - expect(table.sort).to eq([ - ["First Name", "Last Name", "Billing Address", "Email", "Phone", "Hub", "Hub Address", - "Shipping Method", "Total Number of Orders", "Total incl. tax ($)", - "Last completed order date"] - ].sort) + expect(table_headers).to eq( + [ + [ + "First Name", "Last Name", "Billing Address", "Email", "Phone", + "Hub", "Hub Address", "Shipping Method", "Total Number of Orders", + "Total incl. tax ($)", "Last completed order date", + ] + ] + ) end end