From 01f870b818bd159f8a6848cb00616b94a5008f3d Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Sun, 9 Jan 2022 18:11:12 +0000 Subject: [PATCH 01/13] Adds coverage on ship_address_same_as_billing option --- spec/support/split_checkout_helper.rb | 9 ++++ spec/system/consumer/split_checkout_spec.rb | 47 ++++++++++++++++----- 2 files changed, 46 insertions(+), 10 deletions(-) diff --git a/spec/support/split_checkout_helper.rb b/spec/support/split_checkout_helper.rb index 1fb8a1fcec..965cd0d252 100644 --- a/spec/support/split_checkout_helper.rb +++ b/spec/support/split_checkout_helper.rb @@ -44,4 +44,13 @@ module SplitCheckoutHelper select "New South Wales", from: "State" end end + + def fill_out(notes) + fill_in 'Any comments or special instructions?', with: "#{notes}" + end + + def proceed_to_payment + click_button "Next - Payment method" + expect(page).to have_current_path("/checkout/payment") + end end diff --git a/spec/system/consumer/split_checkout_spec.rb b/spec/system/consumer/split_checkout_spec.rb index 252fc97c74..55024208c3 100644 --- a/spec/system/consumer/split_checkout_spec.rb +++ b/spec/system/consumer/split_checkout_spec.rb @@ -154,23 +154,50 @@ describe "As a consumer, I want to checkout my order", js: true do end it "redirects the user to the Payment Method step" do - fill_in 'Any comments or special instructions?', with: "SpEcIaL NoTeS" - click_button "Next - Payment method" - expect(page).to have_current_path("/checkout/payment") + fill_out("SpEcIaL NoTeS") + proceed_to_payment end end - describe "selecting a delivery shipping method and submiting the form" do + describe "selecting a delivery method" do before do choose shipping_with_fee.name - uncheck "ship_address_same_as_billing" end - it "redirects the user to the Payment Method step" do - fill_out_shipping_address - fill_in 'Any comments or special instructions?', with: "SpEcIaL NoTeS" - click_button "Next - Payment method" - expect(page).to have_current_path("/checkout/payment") + context "with same shipping and billing address" do + before do + check "ship_address_same_as_billing" + end + + it "does not display the shipping address form" do + within(:xpath, './/div[@class="checkout-substep"][3]') do + expect(page).not_to have_field "order_ship_address_attributes_address1" + end + end + + it "redirects the user to the Payment Method step, when submiting the form" do + click_button "Next - Payment method" + expect(page).to have_current_path("/checkout/payment") + end + end + + context "with different shipping and billing address" do + before do + uncheck "ship_address_same_as_billing" + end + + it "displays the shipping address form" do + within(:xpath, './/div[@class="checkout-substep"][3]') do + expect(page).to have_field "order_ship_address_attributes_address1" + end + end + + it "fills in shipping details and redirects the user to the Payment Method step, + when submiting the form" do + fill_out_shipping_address + fill_out("SpEcIaL NoTeS") + proceed_to_payment + end end end end From 0da2d6e4692a57db5c688f383216bedc980f20f8 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Mon, 10 Jan 2022 11:55:55 +0000 Subject: [PATCH 02/13] Adds coverage for required fields - address shipping --- spec/system/consumer/split_checkout_spec.rb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/spec/system/consumer/split_checkout_spec.rb b/spec/system/consumer/split_checkout_spec.rb index 55024208c3..455dead0d9 100644 --- a/spec/system/consumer/split_checkout_spec.rb +++ b/spec/system/consumer/split_checkout_spec.rb @@ -168,7 +168,6 @@ describe "As a consumer, I want to checkout my order", js: true do before do check "ship_address_same_as_billing" end - it "does not display the shipping address form" do within(:xpath, './/div[@class="checkout-substep"][3]') do expect(page).not_to have_field "order_ship_address_attributes_address1" @@ -185,13 +184,23 @@ describe "As a consumer, I want to checkout my order", js: true do before do uncheck "ship_address_same_as_billing" end - it "displays the shipping address form" do within(:xpath, './/div[@class="checkout-substep"][3]') do expect(page).to have_field "order_ship_address_attributes_address1" end end + it "displays error messages when submitting incomplete billing address" do + click_button "Next - Payment method" + expect(page).to have_content "Saving failed, please update the highlighted fields." + within(:xpath, './/div[@class="checkout-substep"][3]') do + expect(page).to have_field("Address", with: "") + expect(page).to have_field("City", with: "") + expect(page).to have_field("Postcode", with: "") + expect(page).to have_content("can't be blank", count: 3) + end + end + it "fills in shipping details and redirects the user to the Payment Method step, when submiting the form" do fill_out_shipping_address From 3ad8e2df4f2c4c997d3340fd28b40adc3ecab243 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Mon, 10 Jan 2022 12:32:05 +0000 Subject: [PATCH 03/13] Adds coverage on mandatory fields - details/billing/shipping --- spec/system/consumer/split_checkout_spec.rb | 29 +++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/spec/system/consumer/split_checkout_spec.rb b/spec/system/consumer/split_checkout_spec.rb index 455dead0d9..3c1978f64d 100644 --- a/spec/system/consumer/split_checkout_spec.rb +++ b/spec/system/consumer/split_checkout_spec.rb @@ -210,16 +210,41 @@ describe "As a consumer, I want to checkout my order", js: true do end end end + + describe "not filling out delivery details" do + before do + fill_in "Email", with: "" + end + it "should display error when fields are empty" do + click_button "Next - Payment method" + expect(page).to have_content("Saving failed, please update the highlighted fields") + within(:xpath, './/div[@class="checkout-substep"][1]') do + expect(page).to have_field("First Name", with: "") # needs to display error, issue #8691 + expect(page).to have_field("Last Name", with: "") # needs to display error, issue #8691 + expect(page).to have_field("Email", with: "") + expect(page).to have_content("is invalid") + expect(page).to have_field("Phone number", with: "") + expect(page).to have_content("can't be blank", count: 2) # update count: 4 after closing #8691 + end + within(:xpath, './/div[@class="checkout-substep"][2]') do + expect(page).to have_field("Address", with: "") + expect(page).to have_field("City", with: "") + expect(page).to have_field("Postcode", with: "") + expect(page).to have_content("can't be blank", count: 3) + end + within(:xpath, './/div[@class="checkout-substep"][3]') do + expect(page).to have_content("Select a shipping method") + end + end + end end context "when I have an out of stock product in my cart" do before do variant.update!(on_demand: false, on_hand: 0) end - it "returns me to the cart with an error message" do visit checkout_path - expect(page).not_to have_selector 'closing', text: "Checkout now" expect(page).to have_selector 'closing', text: "Your shopping cart" expect(page).to have_content "An item in your cart has become unavailable" From f3e07992056ea4b38d499dcb3996361165d3cb02 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Mon, 10 Jan 2022 15:52:54 +0000 Subject: [PATCH 04/13] Adds DB validation for same ship and bill addresses --- spec/system/consumer/split_checkout_spec.rb | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/spec/system/consumer/split_checkout_spec.rb b/spec/system/consumer/split_checkout_spec.rb index 3c1978f64d..b52198e16b 100644 --- a/spec/system/consumer/split_checkout_spec.rb +++ b/spec/system/consumer/split_checkout_spec.rb @@ -175,8 +175,12 @@ describe "As a consumer, I want to checkout my order", js: true do end it "redirects the user to the Payment Method step, when submiting the form" do - click_button "Next - Payment method" - expect(page).to have_current_path("/checkout/payment") + proceed_to_payment + # asserts whether shipping and billing addresses are the same + ship_add_id = Spree::Order.first.ship_address_id + bill_add_id = Spree::Order.first.bill_address_id + expect(Spree::Address.where(id: bill_add_id).pluck(:address1) == + Spree::Address.where(id: ship_add_id).pluck(:address1)).to be true end end @@ -184,7 +188,7 @@ describe "As a consumer, I want to checkout my order", js: true do before do uncheck "ship_address_same_as_billing" end - it "displays the shipping address form" do + it "displays the shipping address form and the option to save it as default" do within(:xpath, './/div[@class="checkout-substep"][3]') do expect(page).to have_field "order_ship_address_attributes_address1" end @@ -206,6 +210,11 @@ describe "As a consumer, I want to checkout my order", js: true do fill_out_shipping_address fill_out("SpEcIaL NoTeS") proceed_to_payment + # asserts whether shipping and billing addresses are the same + ship_add_id = Spree::Order.first.ship_address_id + bill_add_id = Spree::Order.first.bill_address_id + expect(Spree::Address.where(id: bill_add_id).pluck(:address1) == + Spree::Address.where(id: ship_add_id).pluck(:address1)).to be false end end end From ec4ec6605119bd6a16187af5cea1a238663470e2 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Mon, 10 Jan 2022 15:54:21 +0000 Subject: [PATCH 05/13] Corrects rubocop offense --- spec/support/split_checkout_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/support/split_checkout_helper.rb b/spec/support/split_checkout_helper.rb index 965cd0d252..2ed27c524f 100644 --- a/spec/support/split_checkout_helper.rb +++ b/spec/support/split_checkout_helper.rb @@ -46,7 +46,7 @@ module SplitCheckoutHelper end def fill_out(notes) - fill_in 'Any comments or special instructions?', with: "#{notes}" + fill_in 'Any comments or special instructions?', with: notes.to_s end def proceed_to_payment From 22d9da9edc5e4372e9b7142d90769b0b44161d22 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Wed, 12 Jan 2022 12:36:49 +0000 Subject: [PATCH 06/13] Changes helper name --- spec/support/split_checkout_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/support/split_checkout_helper.rb b/spec/support/split_checkout_helper.rb index 2ed27c524f..9f14fd2f21 100644 --- a/spec/support/split_checkout_helper.rb +++ b/spec/support/split_checkout_helper.rb @@ -45,8 +45,8 @@ module SplitCheckoutHelper end end - def fill_out(notes) - fill_in 'Any comments or special instructions?', with: notes.to_s + def fill_notes(text) + fill_in 'Any comments or special instructions?', with: text.to_s end def proceed_to_payment From ab2d92ab8f2b6a847bbbb6327fd751c25f3a4c45 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Wed, 12 Jan 2022 12:39:30 +0000 Subject: [PATCH 07/13] Applies helper change on spec file --- spec/system/consumer/split_checkout_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/system/consumer/split_checkout_spec.rb b/spec/system/consumer/split_checkout_spec.rb index b52198e16b..252ef3823d 100644 --- a/spec/system/consumer/split_checkout_spec.rb +++ b/spec/system/consumer/split_checkout_spec.rb @@ -154,7 +154,7 @@ describe "As a consumer, I want to checkout my order", js: true do end it "redirects the user to the Payment Method step" do - fill_out("SpEcIaL NoTeS") + fill_notes("SpEcIaL NoTeS") proceed_to_payment end end @@ -208,7 +208,7 @@ describe "As a consumer, I want to checkout my order", js: true do it "fills in shipping details and redirects the user to the Payment Method step, when submiting the form" do fill_out_shipping_address - fill_out("SpEcIaL NoTeS") + fill_notes("SpEcIaL NoTeS") proceed_to_payment # asserts whether shipping and billing addresses are the same ship_add_id = Spree::Order.first.ship_address_id From 25244725e91e8e93375eb929131ce22880eaf65f Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Wed, 12 Jan 2022 15:24:14 +0000 Subject: [PATCH 08/13] Changes assertion from URL to page content --- spec/support/split_checkout_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/support/split_checkout_helper.rb b/spec/support/split_checkout_helper.rb index 9f14fd2f21..59e8ddb16b 100644 --- a/spec/support/split_checkout_helper.rb +++ b/spec/support/split_checkout_helper.rb @@ -51,6 +51,6 @@ module SplitCheckoutHelper def proceed_to_payment click_button "Next - Payment method" - expect(page).to have_current_path("/checkout/payment") + expect(page).to have_button("Next - Order summary") end end From ee601bb357830c08295bc41b2d31e45a843d2649 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Wed, 12 Jan 2022 15:37:07 +0000 Subject: [PATCH 09/13] Uses reload to fetch bill/ship address ids --- spec/system/consumer/split_checkout_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/system/consumer/split_checkout_spec.rb b/spec/system/consumer/split_checkout_spec.rb index 252ef3823d..d34248e947 100644 --- a/spec/system/consumer/split_checkout_spec.rb +++ b/spec/system/consumer/split_checkout_spec.rb @@ -177,8 +177,8 @@ describe "As a consumer, I want to checkout my order", js: true do it "redirects the user to the Payment Method step, when submiting the form" do proceed_to_payment # asserts whether shipping and billing addresses are the same - ship_add_id = Spree::Order.first.ship_address_id - bill_add_id = Spree::Order.first.bill_address_id + ship_add_id = order.reload.ship_address_id + bill_add_id = order.reload.bill_address_id expect(Spree::Address.where(id: bill_add_id).pluck(:address1) == Spree::Address.where(id: ship_add_id).pluck(:address1)).to be true end From 3b6bb1c9a8f9c7c30611f41ec7b63e8c2887aa63 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Wed, 12 Jan 2022 16:41:17 +0000 Subject: [PATCH 10/13] Removes within blocks; replaces field names by ids --- spec/support/split_checkout_helper.rb | 39 +++++++++++---------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/spec/support/split_checkout_helper.rb b/spec/support/split_checkout_helper.rb index 59e8ddb16b..7b6cafe8cf 100644 --- a/spec/support/split_checkout_helper.rb +++ b/spec/support/split_checkout_helper.rb @@ -14,35 +14,28 @@ module SplitCheckoutHelper end def fill_out_details - # Section: Your Details - within(:xpath, './/div[@class="checkout-substep"][1]') do - fill_in "First Name", with: "Will" - fill_in "Last Name", with: "Marshall" - fill_in "Email", with: "test@test.com" - fill_in "Phone", with: "0468363090" - end + fill_in "First Name", with: "Will" + fill_in "Last Name", with: "Marshall" + fill_in "Email", with: "test@test.com" + fill_in "Phone", with: "0468363090" end def fill_out_billing_address - # Section: Your Billing Address - within(:xpath, './/div[@class="checkout-substep"][2]') do - fill_in "Address", with: "Rue de la Vie, 77" - fill_in "City", with: "Melbourne" - fill_in "Postcode", with: "3066" - select "Australia", from: "Country" - select "Victoria", from: "State" - end + fill_in "order_bill_address_attributes_address1", with: "Rue de la Vie, 77" + fill_in "order_bill_address_attributes_address2", with: "2nd floor" + fill_in "order_bill_address_attributes_city", with: "Melbourne" + fill_in "order_bill_address_attributes_zipcode", with: "3066" + select "Australia", from: "order_bill_address_attributes_country_id" + select "Victoria", from: "order_bill_address_attributes_state_id" end def fill_out_shipping_address - # Section: Delivery Address - within(:xpath, './/div[@class="checkout-substep"][3]') do - fill_in "Address", with: "Rue de la Vie, 66" - fill_in "City", with: "Perth" - fill_in "Postcode", with: "2899" - select "Australia", from: "Country" - select "New South Wales", from: "State" - end + fill_in "order_ship_address_attributes_address1", with: "Rue de la Vie, 66" + fill_in "order_ship_address_attributes_address2", with: "3rd floor" + fill_in "order_ship_address_attributes_city", with: "Perth" + fill_in "order_ship_address_attributes_zipcode", with: "6603" + select "Australia", from: "order_ship_address_attributes_country_id" + select "New South Wales", from: "order_ship_address_attributes_state_id" end def fill_notes(text) From 63ae15909158a93667eb7c68e8c8b493ed7fddc7 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Tue, 18 Jan 2022 15:10:31 +0000 Subject: [PATCH 11/13] 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 From f250f6dc53308fe073038b76506aa767a3bf53cb Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Tue, 18 Jan 2022 15:12:15 +0000 Subject: [PATCH 12/13] Updates mandatory field error count after merging #8691 --- spec/system/consumer/split_checkout_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/system/consumer/split_checkout_spec.rb b/spec/system/consumer/split_checkout_spec.rb index 2dfaf10e19..4e01981315 100644 --- a/spec/system/consumer/split_checkout_spec.rb +++ b/spec/system/consumer/split_checkout_spec.rb @@ -226,12 +226,12 @@ describe "As a consumer, I want to checkout my order", js: true do click_button "Next - Payment method" expect(page).to have_content("Saving failed, please update the highlighted fields") within(:xpath, './/div[@class="checkout-substep"][1]') do - expect(page).to have_field("First Name", with: "") # needs to display error, issue #8691 - expect(page).to have_field("Last Name", with: "") # needs to display error, issue #8691 + expect(page).to have_field("First Name", with: "") + expect(page).to have_field("Last Name", with: "") expect(page).to have_field("Email", with: "") expect(page).to have_content("is invalid") expect(page).to have_field("Phone number", with: "") - expect(page).to have_content("can't be blank", count: 2) # update count: 4 after closing #8691 + expect(page).to have_content("can't be blank", count: 4) end within(:xpath, './/div[@class="checkout-substep"][2]') do expect(page).to have_field("Address", with: "") From 9ef8e86e59e475351b6079a674115ecc94a9923b Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Tue, 18 Jan 2022 18:09:14 +0000 Subject: [PATCH 13/13] Removes xpath within blocks on spec file --- spec/system/consumer/split_checkout_spec.rb | 46 +++++++-------------- 1 file changed, 16 insertions(+), 30 deletions(-) diff --git a/spec/system/consumer/split_checkout_spec.rb b/spec/system/consumer/split_checkout_spec.rb index 4e01981315..5a6f2cd0d9 100644 --- a/spec/system/consumer/split_checkout_spec.rb +++ b/spec/system/consumer/split_checkout_spec.rb @@ -73,7 +73,6 @@ describe "As a consumer, I want to checkout my order", js: true do it "should redirect to the login page when clicking the login button" do click_on "Login" expect(page).to have_content("Login") - expect(page).to have_content("Login") end end @@ -167,9 +166,7 @@ describe "As a consumer, I want to checkout my order", js: true do check "ship_address_same_as_billing" end it "does not display the shipping address form" do - within(:xpath, './/div[@class="checkout-substep"][3]') do - expect(page).not_to have_field "order_ship_address_attributes_address1" - end + expect(page).not_to have_field "order_ship_address_attributes_address1" end it "redirects the user to the Payment Method step, when submiting the form" do @@ -187,20 +184,16 @@ describe "As a consumer, I want to checkout my order", js: true do uncheck "ship_address_same_as_billing" end it "displays the shipping address form and the option to save it as default" do - within(:xpath, './/div[@class="checkout-substep"][3]') do - expect(page).to have_field "order_ship_address_attributes_address1" - end + expect(page).to have_field "order_ship_address_attributes_address1" end it "displays error messages when submitting incomplete billing address" do click_button "Next - Payment method" expect(page).to have_content "Saving failed, please update the highlighted fields." - within(:xpath, './/div[@class="checkout-substep"][3]') do - expect(page).to have_field("Address", with: "") - expect(page).to have_field("City", with: "") - expect(page).to have_field("Postcode", with: "") - expect(page).to have_content("can't be blank", count: 3) - end + expect(page).to have_field("Address", with: "") + expect(page).to have_field("City", with: "") + expect(page).to have_field("Postcode", with: "") + expect(page).to have_content("can't be blank", count: 3) end it "fills in shipping details and redirects the user to the Payment Method step, @@ -225,23 +218,16 @@ describe "As a consumer, I want to checkout my order", js: true do it "should display error when fields are empty" do click_button "Next - Payment method" expect(page).to have_content("Saving failed, please update the highlighted fields") - within(:xpath, './/div[@class="checkout-substep"][1]') do - expect(page).to have_field("First Name", with: "") - expect(page).to have_field("Last Name", with: "") - expect(page).to have_field("Email", with: "") - expect(page).to have_content("is invalid") - expect(page).to have_field("Phone number", with: "") - expect(page).to have_content("can't be blank", count: 4) - end - within(:xpath, './/div[@class="checkout-substep"][2]') do - expect(page).to have_field("Address", with: "") - expect(page).to have_field("City", with: "") - expect(page).to have_field("Postcode", with: "") - expect(page).to have_content("can't be blank", count: 3) - end - within(:xpath, './/div[@class="checkout-substep"][3]') do - expect(page).to have_content("Select a shipping method") - end + expect(page).to have_field("First Name", with: "") + expect(page).to have_field("Last Name", with: "") + expect(page).to have_field("Email", with: "") + expect(page).to have_content("is invalid") + expect(page).to have_field("Phone number", with: "") + expect(page).to have_field("Address", with: "") + expect(page).to have_field("City", with: "") + expect(page).to have_field("Postcode", with: "") + expect(page).to have_content("can't be blank", count: 7) + expect(page).to have_content("Select a shipping method") end end end