From c5d94d372f37e9386deef3ab3db04b857428761c Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bellet Date: Fri, 13 Jan 2023 09:21:15 +0100 Subject: [PATCH] Remove unnecessary `within` block --- spec/system/consumer/split_checkout_spec.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/spec/system/consumer/split_checkout_spec.rb b/spec/system/consumer/split_checkout_spec.rb index 88e3caca77..f0b3f0446d 100644 --- a/spec/system/consumer/split_checkout_spec.rb +++ b/spec/system/consumer/split_checkout_spec.rb @@ -455,9 +455,8 @@ describe "As a consumer, I want to checkout my order", js: true do shared_examples "displays the shipping fee" do |checkout_page| it "on the #{checkout_page} page" do - within ".summary-right" do - expect(page).to have_content("Shipping #{with_currency(4.56)}") - end + expect(page).to have_content("Shipping #{with_currency(4.56)}") + if checkout_page.eql?("order confirmation") expect(page).to have_content "Your order has been processed successfully" end @@ -588,9 +587,8 @@ describe "As a consumer, I want to checkout my order", js: true do shared_examples "displays the transaction fee" do |checkout_page| it "on the #{checkout_page} page" do - within ".summary-right" do - expect(page).to have_content("Transaction fee #{with_currency(1.23)}") - end + expect(page).to have_content("Transaction fee #{with_currency(1.23)}") + if checkout_page.eql?("order confirmation") expect(page).to have_content "Your order has been processed successfully" end