From 63ae15909158a93667eb7c68e8c8b493ed7fddc7 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Tue, 18 Jan 2022 15:10:31 +0000 Subject: [PATCH] Changes assertion from URL to page content on spec file --- spec/system/consumer/split_checkout_spec.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/spec/system/consumer/split_checkout_spec.rb b/spec/system/consumer/split_checkout_spec.rb index d34248e947..2dfaf10e19 100644 --- a/spec/system/consumer/split_checkout_spec.rb +++ b/spec/system/consumer/split_checkout_spec.rb @@ -58,7 +58,6 @@ describe "As a consumer, I want to checkout my order", js: true do it "should display the split checkout login page" do expect(page).to have_content distributor.name - expect(page).to have_current_path("/checkout/guest") expect(page).to have_content("Ok, ready to checkout?") expect(page).to have_content("Login") expect(page).to have_no_content("Checkout as guest") @@ -68,12 +67,13 @@ describe "As a consumer, I want to checkout my order", js: true do order.update(state: "payment") get checkout_step_path(:details) expect(response).to have_http_status(:redirect) - expect(page).to have_current_path("/checkout/guest") + expect(page).to have_content("Ok, ready to checkout?") end it "should redirect to the login page when clicking the login button" do click_on "Login" - expect(page).to have_current_path "/" + expect(page).to have_content("Login") + expect(page).to have_content("Login") end end @@ -86,7 +86,6 @@ describe "As a consumer, I want to checkout my order", js: true do it "should display the split checkout login/guest page" do expect(page).to have_content distributor.name - expect(page).to have_current_path("/checkout/guest") expect(page).to have_content("Ok, ready to checkout?") expect(page).to have_content("Login") expect(page).to have_content("Checkout as guest") @@ -95,7 +94,6 @@ describe "As a consumer, I want to checkout my order", js: true do it "should display the split checkout details page" do click_on "Checkout as guest" expect(page).to have_content distributor.name - expect(page).to have_current_path("/checkout/details") expect(page).to have_content("1 - Your details") expect(page).to have_selector("div.checkout-tab.selected", text: "1 - Your details") expect(page).to have_content("2 - Payment method") @@ -122,14 +120,14 @@ describe "As a consumer, I want to checkout my order", js: true do choose free_shipping.name click_button "Next - Payment method" - expect(page).to have_current_path("/checkout/payment") + expect(page).to have_button("Next - Order summary") end context "when order is state: 'payment'" do it "should allow visit '/checkout/details'" do order.update(state: "payment") visit checkout_step_path(:details) - expect(page).to have_current_path("/checkout/details") + expect(page).to have_button("Next - Payment method") end end end