From 08d4aea2b93b32ce73f992371ca1753b417934c0 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bellet Date: Fri, 11 Mar 2022 17:20:03 +0100 Subject: [PATCH] "Send a cancellation email to the customer" checked by default --- .../javascripts/admin/spree/orders/variant_autocomplete.js.erb | 2 +- spec/system/admin/order_spec.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/admin/spree/orders/variant_autocomplete.js.erb b/app/assets/javascripts/admin/spree/orders/variant_autocomplete.js.erb index 90e4c9a14d..f49a9e1ec1 100644 --- a/app/assets/javascripts/admin/spree/orders/variant_autocomplete.js.erb +++ b/app/assets/javascripts/admin/spree/orders/variant_autocomplete.js.erb @@ -198,7 +198,7 @@ ofnCancelOrderAlert = function(callback) { $('#custom-confirm .message').html( ` ${t("js.admin.orders.cancel_the_order_html")}
- +
`); $('#custom-confirm button.confirm').unbind( "click" ).click(() => { diff --git a/spec/system/admin/order_spec.rb b/spec/system/admin/order_spec.rb index 7e726839d1..69b74eca9c 100644 --- a/spec/system/admin/order_spec.rb +++ b/spec/system/admin/order_spec.rb @@ -172,6 +172,7 @@ describe ' context "it shows a second modal about last item deletion and therefore about order cancellation" do it "that the user can close and then nothing change" do expect(page).to have_content "This will cancel the current order." + expect(page).to have_checked_field "Send a cancellation email to the customer" within(".modal", visible: true) do click_on("Cancel") end @@ -184,6 +185,7 @@ describe ' it "and then the order is cancelled and no email is sent by default" do expect do within(".modal", visible: true) do + uncheck("send_cancellation_email") click_on("OK") end expect(page).to have_content "Cannot add item to canceled order" @@ -195,7 +197,6 @@ describe ' it "and check the checkbox to send an email to the customer about its order cancellation" do expect do within(".modal", visible: true) do - check("send_cancellation_email") click_on("OK") end expect(page).to have_content "Cannot add item to canceled order"