From edfd0fd95c0e0ada8eaea46ecd40d1c098e57e58 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Tue, 18 Aug 2020 14:12:59 +0100 Subject: [PATCH] Move checkout helpers to checkout_helper --- .../consumer/shopping/checkout_spec.rb | 32 ------------------- spec/support/request/checkout_helper.rb | 32 +++++++++++++++++++ 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/spec/features/consumer/shopping/checkout_spec.rb b/spec/features/consumer/shopping/checkout_spec.rb index 275bcb4105..31a11b8d1d 100644 --- a/spec/features/consumer/shopping/checkout_spec.rb +++ b/spec/features/consumer/shopping/checkout_spec.rb @@ -455,36 +455,4 @@ feature "As a consumer I want to check out my cart", js: true do end end end - - def fill_out_details - within "#details" 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 - end - - def fill_out_billing_address - within "#billing" do - fill_in "City", with: "Melbourne" - fill_in "Postcode", with: "3066" - fill_in "Address", with: "123 Your Head" - select "Australia", from: "Country" - select "Victoria", from: "State" - end - end - - def fill_out_form - choose free_shipping.name - choose check_without_fee.name - - fill_out_details - check "Save as default billing address" - - fill_out_billing_address - - check "Shipping address same as billing address?" - check "Save as default shipping address" - end end diff --git a/spec/support/request/checkout_helper.rb b/spec/support/request/checkout_helper.rb index 45204f13a1..d6c2a70d91 100644 --- a/spec/support/request/checkout_helper.rb +++ b/spec/support/request/checkout_helper.rb @@ -18,4 +18,36 @@ module CheckoutHelper def toggle_details toggle_accordion :details end + + def fill_out_details + within "#details" 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 + end + + def fill_out_billing_address + within "#billing" do + fill_in "City", with: "Melbourne" + fill_in "Postcode", with: "3066" + fill_in "Address", with: "123 Your Head" + select "Australia", from: "Country" + select "Victoria", from: "State" + end + end + + def fill_out_form + choose free_shipping.name + choose check_without_fee.name + + fill_out_details + check "Save as default billing address" + + fill_out_billing_address + + check "Shipping address same as billing address?" + check "Save as default shipping address" + end end