mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Use reports helper to DRY
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user