From ea73781668f583d745dcaea29bb66853acf05e18 Mon Sep 17 00:00:00 2001 From: Gaetan Craig-Riou Date: Tue, 20 Jun 2023 10:03:55 +1000 Subject: [PATCH 1/2] Fix bulk order cancellation Add unticking of "send cancellation email to customer" to match the current test expectation --- spec/system/admin/orders_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/system/admin/orders_spec.rb b/spec/system/admin/orders_spec.rb index d7d4131eb7..0e3b91051d 100644 --- a/spec/system/admin/orders_spec.rb +++ b/spec/system/admin/orders_spec.rb @@ -554,6 +554,8 @@ distributors: [distributor4, distributor5]) } expect(page).to have_content "This will cancel the current order." within ".reveal-modal" do + # Untick SEND A CANCELLATION EMAIL TO THE CUSTOMER + page.find("input[id='send_cancellation_email']").click expect { find_button("Cancel").click # Cancels the cancel action }.to_not enqueue_job(ActionMailer::MailDeliveryJob).exactly(:twice) From 029364d4a3d8952e22a323f501f1cb87eb9f88b2 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Thu, 29 Jun 2023 14:25:50 +1000 Subject: [PATCH 2/2] Express spec intent with DSL instead of comment --- spec/system/admin/orders_spec.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spec/system/admin/orders_spec.rb b/spec/system/admin/orders_spec.rb index 0e3b91051d..164ae45584 100644 --- a/spec/system/admin/orders_spec.rb +++ b/spec/system/admin/orders_spec.rb @@ -554,8 +554,7 @@ distributors: [distributor4, distributor5]) } expect(page).to have_content "This will cancel the current order." within ".reveal-modal" do - # Untick SEND A CANCELLATION EMAIL TO THE CUSTOMER - page.find("input[id='send_cancellation_email']").click + uncheck "Send a cancellation email to the customer" expect { find_button("Cancel").click # Cancels the cancel action }.to_not enqueue_job(ActionMailer::MailDeliveryJob).exactly(:twice)