Add spec for bulk "Resend email confirmation" action

This commit is contained in:
Jean-Baptiste Bellet
2022-10-17 17:10:03 +02:00
parent 7e844ee289
commit edc0c189df

View File

@@ -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