mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
DRY up specs
This commit is contained in:
@@ -104,9 +104,7 @@ describe "Sales Tax Totals By order" do
|
||||
end
|
||||
|
||||
it "generates the report" do
|
||||
login_as admin
|
||||
visit admin_reports_path
|
||||
click_on "Sales Tax Totals By Order"
|
||||
visit_sales_tax_totals_by_order
|
||||
|
||||
expect(page).to have_button("Go")
|
||||
click_on "Go"
|
||||
@@ -165,10 +163,9 @@ describe "Sales Tax Totals By order" do
|
||||
order.recreate_all_fees!
|
||||
OrderWorkflow.new(order).complete!
|
||||
end
|
||||
|
||||
it "generates the report" do
|
||||
login_as admin
|
||||
visit admin_reports_path
|
||||
click_on "Sales Tax Totals By Order"
|
||||
visit_sales_tax_totals_by_order
|
||||
|
||||
expect(page).to have_button("Go")
|
||||
click_on "Go"
|
||||
@@ -334,9 +331,7 @@ describe "Sales Tax Totals By order" do
|
||||
order2.recreate_all_fees!
|
||||
OrderWorkflow.new(order2).complete!
|
||||
|
||||
login_as admin
|
||||
visit admin_reports_path
|
||||
click_on "Sales Tax Totals By Order"
|
||||
visit_sales_tax_totals_by_order
|
||||
end
|
||||
|
||||
it "should load all the orders" do
|
||||
@@ -467,6 +462,12 @@ describe "Sales Tax Totals By order" do
|
||||
end
|
||||
end
|
||||
|
||||
def visit_sales_tax_totals_by_order
|
||||
login_as admin
|
||||
visit admin_reports_path
|
||||
click_on "Sales Tax Totals By Order"
|
||||
end
|
||||
|
||||
def generate_report
|
||||
click_on "Go"
|
||||
wait_for_download
|
||||
|
||||
Reference in New Issue
Block a user