mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-26 01:33:22 +00:00
Restructures spec to accommodate shared example on bulk printing
This commit is contained in:
@@ -140,25 +140,29 @@ RSpec.describe '
|
||||
end
|
||||
end
|
||||
|
||||
it "can bulk send confirmation email from 2 orders" do
|
||||
page.find("#listing_orders tbody tr:nth-child(1) input[name='bulk_ids[]']").click
|
||||
page.find("#listing_orders tbody tr:nth-child(2) input[name='bulk_ids[]']").click
|
||||
shared_examples "can bulk send confirmation email from 2 orders" do
|
||||
it "bulk prints invoices in pdf format" do
|
||||
page.find("#listing_orders tbody tr:nth-child(1) input[name='bulk_ids[]']").click
|
||||
page.find("#listing_orders tbody tr:nth-child(2) input[name='bulk_ids[]']").click
|
||||
|
||||
page.find("span.icon-reorder", text: "ACTIONS").click
|
||||
within ".ofn-drop-down .menu" do
|
||||
page.find("span", text: "Resend Confirmation").click
|
||||
page.find("span.icon-reorder", text: "ACTIONS").click
|
||||
within ".ofn-drop-down .menu" do
|
||||
page.find("span", text: "Resend Confirmation").click
|
||||
end
|
||||
|
||||
expect(page).to have_content "Are you sure you want to proceed?"
|
||||
|
||||
within ".reveal-modal" do
|
||||
expect {
|
||||
find_button("Confirm").click
|
||||
}.to enqueue_job(ActionMailer::MailDeliveryJob).exactly(:twice)
|
||||
end
|
||||
|
||||
expect(page).to have_content "Confirmation emails sent for 2 orders."
|
||||
end
|
||||
|
||||
expect(page).to have_content "Are you sure you want to proceed?"
|
||||
|
||||
within ".reveal-modal" do
|
||||
expect {
|
||||
find_button("Confirm").click
|
||||
}.to enqueue_job(ActionMailer::MailDeliveryJob).exactly(:twice)
|
||||
end
|
||||
|
||||
expect(page).to have_content "Confirmation emails sent for 2 orders."
|
||||
end
|
||||
|
||||
it_behaves_like "can bulk send confirmation email from 2 orders"
|
||||
end
|
||||
|
||||
context "can bulk print invoices" do
|
||||
|
||||
Reference in New Issue
Block a user