diff --git a/spec/support/split_checkout_helper.rb b/spec/support/split_checkout_helper.rb index 7b6cafe8cf..24a80c50d6 100644 --- a/spec/support/split_checkout_helper.rb +++ b/spec/support/split_checkout_helper.rb @@ -46,4 +46,11 @@ module SplitCheckoutHelper click_button "Next - Payment method" expect(page).to have_button("Next - Order summary") end + + def expect_to_be_on_first_step + 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") + expect(page).to have_content("3 - Order summary") + end end diff --git a/spec/system/consumer/split_checkout_spec.rb b/spec/system/consumer/split_checkout_spec.rb index bd9af52961..cd7e741d1c 100644 --- a/spec/system/consumer/split_checkout_spec.rb +++ b/spec/system/consumer/split_checkout_spec.rb @@ -103,10 +103,7 @@ 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_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") - expect(page).to have_content("3 - Order summary") + expect_to_be_on_first_step end it "should display error when fields are empty" do