mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Add spec for bulk "Resend email confirmation" action
This commit is contained in:
@@ -122,6 +122,34 @@ describe '
|
||||
end
|
||||
end
|
||||
|
||||
context "bulk actions" do
|
||||
context "resend confirmation email" do
|
||||
it "can bulk send email to 2 orders" do
|
||||
login_as_admin_and_visit spree.admin_orders_path
|
||||
|
||||
page.find("#listing_orders tbody tr:nth-child(1) input[name='order_ids[]']").click
|
||||
page.find("#listing_orders tbody tr:nth-child(2) input[name='order_ids[]']").click
|
||||
|
||||
page.find("span.icon-reorder", text: "ACTIONS").click
|
||||
within ".ofn-drop-down-with-prepend .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
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "with a capturable order" do
|
||||
before do
|
||||
order.finalize! # ensure order has a payment to capture
|
||||
|
||||
Reference in New Issue
Block a user