From aa2a5757ecff2146e727a174c543e25e47f7911f Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 16 Oct 2024 16:12:35 +1100 Subject: [PATCH] Move Customers report spec to own file --- .../admin/reports/customers_report_spec.rb | 25 +++++++++++++++++++ spec/system/admin/reports_spec.rb | 22 ---------------- 2 files changed, 25 insertions(+), 22 deletions(-) create mode 100644 spec/system/admin/reports/customers_report_spec.rb diff --git a/spec/system/admin/reports/customers_report_spec.rb b/spec/system/admin/reports/customers_report_spec.rb new file mode 100644 index 0000000000..7f5caaab46 --- /dev/null +++ b/spec/system/admin/reports/customers_report_spec.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +require "system_helper" + +RSpec.describe "Customers report" do + include AuthenticationHelper + + it "can be rendered" do + login_as_admin + visit admin_reports_path + + within "table.index" do + click_link "Customers" + 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) + end +end diff --git a/spec/system/admin/reports_spec.rb b/spec/system/admin/reports_spec.rb index 57d7dfff22..072c546646 100644 --- a/spec/system/admin/reports_spec.rb +++ b/spec/system/admin/reports_spec.rb @@ -151,28 +151,6 @@ RSpec.describe ' end end - describe "Can access Customers reports and generate customers report" do - before do - login_as_admin - visit admin_reports_path - end - - it "customers report" do - within "table.index" do - click_link "Customers" - 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) - end - end - describe "Order cycle management report" do before do login_as_admin