mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Display error messages to user for convencience
It will also help us to debug the application if the error is not obvious.
This commit is contained in:
@@ -36,7 +36,10 @@ class SplitCheckoutController < ::BaseController
|
||||
advance_order_state
|
||||
redirect_to_step
|
||||
else
|
||||
flash.now[:error] ||= I18n.t('split_checkout.errors.global')
|
||||
flash.now[:error] ||= I18n.t(
|
||||
'split_checkout.errors.saving_failed',
|
||||
messages: @order.errors.full_messages.to_sentence
|
||||
)
|
||||
|
||||
render status: :unprocessable_entity, operations: cable_car.
|
||||
replace("#checkout", partial("split_checkout/checkout")).
|
||||
|
||||
@@ -1997,6 +1997,7 @@ en:
|
||||
cancel: Back to Payment method
|
||||
errors:
|
||||
global: "Saving failed, please update the highlighted fields."
|
||||
saving_failed: "Saving failed, please update the highlighted fields. %{messages}"
|
||||
terms_not_accepted: Please accept Terms and Conditions
|
||||
required: Field cannot be blank
|
||||
invalid_number: "Please enter a valid phone number"
|
||||
|
||||
@@ -294,6 +294,7 @@ describe "As a consumer, I want to checkout my order" do
|
||||
click_button "Next - Payment method"
|
||||
|
||||
expect(page).to have_content "Saving failed, please update the highlighted fields."
|
||||
expect(page).to have_content "Ship address address1 can't be blank"
|
||||
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?"
|
||||
|
||||
Reference in New Issue
Block a user