From 0a3d362282262864b0787be95eebebf8cdd172df Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bellet Date: Wed, 15 Feb 2023 10:00:53 +0100 Subject: [PATCH] Still improve error message for Billing address ``` "Bill" is a person's name, and I don't know his address ``` ;) --- config/locales/en.yml | 8 ++++++-- spec/models/spree/order_spec.rb | 2 +- spec/system/consumer/split_checkout_spec.rb | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index c33177750a..49b7506aef 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -36,8 +36,12 @@ en: lastname: "Last name" zipcode: "Shipping address postcode" spree/order/bill_address: - address1: "Bill address (Street + House number)" - zipcode: "Bill address postcode" + address1: "Billing address (Street + House number)" + zipcode: "Billing address postcode" + city: "Billing address city" + country: "Billing address country" + firstname: "Billing address first name" + lastname: "Billing address last name" phone: Customer phone spree/user: password: "Password" diff --git a/spec/models/spree/order_spec.rb b/spec/models/spree/order_spec.rb index cce3536522..3ba51a4e81 100644 --- a/spec/models/spree/order_spec.rb +++ b/spec/models/spree/order_spec.rb @@ -18,7 +18,7 @@ describe Spree::Order do it "provides friendly error messages for bill address" do order.bill_address = Spree::Address.new order.save - expect(order.errors.full_messages).to include "Bill address (Street + House number) can't be blank" + expect(order.errors.full_messages).to include "Billing address (Street + House number) can't be blank" end end diff --git a/spec/system/consumer/split_checkout_spec.rb b/spec/system/consumer/split_checkout_spec.rb index f595e64159..b293aff3df 100644 --- a/spec/system/consumer/split_checkout_spec.rb +++ b/spec/system/consumer/split_checkout_spec.rb @@ -211,7 +211,7 @@ describe "As a consumer, I want to checkout my order" do end it "should display error message in the right order" do - expect(page).to have_content "Customer E-Mail can't be blank, Customer E-Mail is invalid, Customer phone can't be blank, Bill address firstname can't be blank, Bill address lastname can't be blank, Bill address (Street + House number) can't be blank, Bill address city can't be blank, Bill address postcode can't be blank, and Shipping method Select a shipping method" + expect(page).to have_content "Customer E-Mail can't be blank, Customer E-Mail is invalid, Customer phone can't be blank, Billing address first name can't be blank, Billing address last name can't be blank, Billing address (Street + House number) can't be blank, Billing address city can't be blank, Billing address postcode can't be blank, and Shipping method Select a shipping method" end end end