mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Display checkbox that "save as default address"
This commit is contained in:
@@ -142,7 +142,7 @@
|
||||
= ship_address.select :state_id, states_for_country(ship_address_country), { selected: @order.ship_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{ "data-toggle-target": "content", style: "display: #{display_ship_address ? 'block' : 'none'}" }
|
||||
= f.check_box :save_ship_address
|
||||
= f.label :save_ship_address, t(:checkout_default_ship_address)
|
||||
|
||||
|
||||
@@ -198,11 +198,13 @@ describe "As a consumer, I want to checkout my order", js: true do
|
||||
it "display the checkbox about shipping address same as billing address when selecting a shipping method that requires ship address" do
|
||||
choose free_shipping_with_required_address.name
|
||||
check "Shipping address same as billing address?"
|
||||
expect(page).to have_content "Save as default shipping address"
|
||||
|
||||
click_button "Next - Payment method"
|
||||
|
||||
expect(page).to have_content "Saving failed, please update the highlighted fields."
|
||||
expect(page).to have_content "Shipping address same as billing address?"
|
||||
expect(page).to have_content "Save as default shipping address"
|
||||
expect(page).to have_checked_field "Shipping address same as billing address?"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user