From f8b8298fbe9f2762f7a3e1f8ebc07ca678e71883 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Mon, 21 Mar 2022 13:23:59 +0000 Subject: [PATCH 1/3] Adds spec on billing address checkbox --- spec/system/consumer/split_checkout_spec.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spec/system/consumer/split_checkout_spec.rb b/spec/system/consumer/split_checkout_spec.rb index 0a5b589e47..902f176dce 100644 --- a/spec/system/consumer/split_checkout_spec.rb +++ b/spec/system/consumer/split_checkout_spec.rb @@ -162,12 +162,23 @@ describe "As a consumer, I want to checkout my order", js: true do context "on the 'details' step" do before do visit checkout_step_path(:details) + click_on "Checkout as guest" end it "should allow visit '/checkout/details'" do expect(page).to have_current_path("/checkout/details") end + it 'does not show the save as default bill address checkbox' do + expect(page).not_to have_content "Save as default billing address" + end + + it 'does not show the save as default ship address checkbox' do + choose free_shipping_with_required_address.name + uncheck "ship_address_same_as_billing" + expect(page).not_to have_content "Save as default shipping address" + end + it_behaves_like "when I have an out of stock product in my cart" end From 95b1911f3842ef96859f06cd70adc253d76f986a Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Mon, 21 Mar 2022 13:30:14 +0000 Subject: [PATCH 2/3] Hides the default address checkbox for guest customers --- app/views/split_checkout/_details.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/split_checkout/_details.html.haml b/app/views/split_checkout/_details.html.haml index d7c7cdbda5..836d3bb170 100644 --- a/app/views/split_checkout/_details.html.haml +++ b/app/views/split_checkout/_details.html.haml @@ -61,8 +61,8 @@ = bill_address.label :state_id, t("split_checkout.step1.address.state_id.label") = bill_address.select :state_id, states_for_country(bill_address_country), { selected: @order.bill_address&.state_id }, { "data-dependant-select-target": "select" } - - if spree_current_user||true - %div.checkout-input + - if spree_current_user + %div.checkout-input{ "data-toggle-target": "content", style: "display: none" } = f.check_box :save_bill_address = f.label :save_bill_address, t(:checkout_default_bill_address) From 843f57ad4f6bd19b97f7d87512455f1e65efe3d1 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Tue, 29 Mar 2022 22:29:43 +0100 Subject: [PATCH 3/3] Removes checkbox attributes --- app/views/split_checkout/_details.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/split_checkout/_details.html.haml b/app/views/split_checkout/_details.html.haml index 836d3bb170..51ee0ab776 100644 --- a/app/views/split_checkout/_details.html.haml +++ b/app/views/split_checkout/_details.html.haml @@ -62,7 +62,7 @@ = bill_address.select :state_id, states_for_country(bill_address_country), { selected: @order.bill_address&.state_id }, { "data-dependant-select-target": "select" } - if spree_current_user - %div.checkout-input{ "data-toggle-target": "content", style: "display: none" } + %div.checkout-input = f.check_box :save_bill_address = f.label :save_bill_address, t(:checkout_default_bill_address)