Merge pull request #9021 from filipefurtad0/improves_guest_checkout

[Split-Checkout] Hides "Save as default billing address" from guest-checkout
This commit is contained in:
Filipe
2022-03-31 10:45:47 +01:00
committed by GitHub
2 changed files with 12 additions and 1 deletions

View File

@@ -61,7 +61,7 @@
= 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
- if spree_current_user
%div.checkout-input
= f.check_box :save_bill_address
= f.label :save_bill_address, t(:checkout_default_bill_address)

View File

@@ -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