From 8d6ed5ec23d2f8c82dd4dcc0d6501a4962acfd1d Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Thu, 19 Oct 2023 17:38:27 +0100 Subject: [PATCH] Moves assertions within before do block Doing so, assures the removal of the invoice is finished, before clicking the 'Next - Order summary' button --- spec/system/consumer/checkout/payment_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/system/consumer/checkout/payment_spec.rb b/spec/system/consumer/checkout/payment_spec.rb index 2a2b70cd83..12536e30d6 100644 --- a/spec/system/consumer/checkout/payment_spec.rb +++ b/spec/system/consumer/checkout/payment_spec.rb @@ -187,14 +187,14 @@ describe "As a consumer, I want to checkout my order" do accept_confirm "Are you sure you want to remove the voucher?" do click_on "Remove code" end - end - it "removes voucher" do within '#voucher-section' do expect(page).to have_button("Apply", disabled: true) expect(page).to have_field "Enter voucher code" # Currently no confirmation msg end + end + it "removes voucher" do expect(page).not_to have_content "No payment required" expect(order.voucher_adjustments.length).to eq(0) end