mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-11 23:17:48 +00:00
Move Customers report spec to own file
This commit is contained in:
25
spec/system/admin/reports/customers_report_spec.rb
Normal file
25
spec/system/admin/reports/customers_report_spec.rb
Normal file
@@ -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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user