diff --git a/spec/system/admin/orders_spec.rb b/spec/system/admin/orders_spec.rb index 723c0df433..679b770a04 100644 --- a/spec/system/admin/orders_spec.rb +++ b/spec/system/admin/orders_spec.rb @@ -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