Moves assertions within before do block

Doing so, assures the removal of the invoice is finished, before clicking the 'Next - Order summary' button
This commit is contained in:
filipefurtad0
2023-10-19 17:38:27 +01:00
parent caa655f500
commit 8d6ed5ec23

View File

@@ -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