Merge pull request #10406 from jibees/10402-error-when-no-shipping-info-has-been-selected-in-split-checkout

SplitCheckout: Fix an issue raised when first time checkout user submit form without selecting shipping method
This commit is contained in:
Konrad
2023-02-13 00:36:04 +01:00
committed by GitHub
2 changed files with 13 additions and 1 deletions

View File

@@ -15,7 +15,7 @@ class DefaultAddressUpdater
assign_bill_addresses
assign_ship_addresses
customer.save
customer&.save
user&.save
end

View File

@@ -284,6 +284,18 @@ describe "As a consumer, I want to checkout my order" do
visit checkout_path
end
context "when no selecting a shipping method" do
before do
fill_out_details
fill_out_billing_address
end
it "errors is shown to the user when submitting the form" do
click_button "Next - Payment method"
expect(page).to have_content "Select a shipping method"
end
end
context "details step" do
context "when form is submitted but invalid" do
it "display the checkbox about shipping address same as billing address when selecting a shipping method that requires ship address" do