diff --git a/spec/system/admin/orders/bulk_actions_spec.rb b/spec/system/admin/orders/bulk_actions_spec.rb index ef97e219bd..4568374c17 100644 --- a/spec/system/admin/orders/bulk_actions_spec.rb +++ b/spec/system/admin/orders/bulk_actions_spec.rb @@ -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