From e6ede3433f83c77620b2042fdd2310d1559a5821 Mon Sep 17 00:00:00 2001 From: Peter Berkenbosch Date: Fri, 1 Sep 2023 11:26:22 +0200 Subject: [PATCH] Update specs to match change in typography MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From the active_model changelog: Improve typography of user facing error messages. In English contractions, the Unicode APOSTROPHE (`U+0027`) is now RIGHT SINGLE QUOTATION MARK (`U+2019`). For example, "can't be blank" is now "can’t be blank". *Jon Dufresne* --- api/spec/requests/spree/api/addresses_spec.rb | 2 +- api/spec/requests/spree/api/checkouts_spec.rb | 6 +++--- api/spec/requests/spree/api/orders_spec.rb | 4 ++-- api/spec/requests/spree/api/payments_spec.rb | 2 +- api/spec/requests/spree/api/products_spec.rb | 2 +- .../admin/style_guide/topics/forms/_validation.html.erb | 6 +++--- .../controllers/spree/admin/promotions_controller_spec.rb | 2 +- .../features/admin/configuration/payment_methods_spec.rb | 2 +- backend/spec/features/admin/configuration/store_spec.rb | 2 +- .../features/admin/configuration/tax_categories_spec.rb | 2 +- .../spec/features/admin/configuration/taxonomies_spec.rb | 2 +- backend/spec/features/admin/orders/adjustments_spec.rb | 4 ++-- backend/spec/features/admin/orders/customer_details_spec.rb | 2 +- backend/spec/features/admin/orders/payments_spec.rb | 6 +++--- backend/spec/features/admin/products/edit/products_spec.rb | 2 +- backend/spec/features/admin/products/products_spec.rb | 4 ++-- backend/spec/features/admin/products/properties_spec.rb | 2 +- .../features/admin/promotions/promotion_categories_spec.rb | 4 ++-- core/spec/lib/calculated_adjustments_spec.rb | 2 +- core/spec/models/spree/address/state_validator_spec.rb | 2 +- core/spec/models/spree/address_spec.rb | 6 +++--- core/spec/models/spree/adjustment_spec.rb | 2 +- core/spec/models/spree/credit_card_spec.rb | 4 ++-- core/spec/models/spree/fulfilment_changer_spec.rb | 4 ++-- core/spec/models/spree/order/validations_spec.rb | 2 +- core/spec/models/spree/order_promotion_spec.rb | 2 +- core/spec/models/spree/payment_spec.rb | 4 ++-- core/spec/models/spree/store_credit_event_spec.rb | 4 ++-- 28 files changed, 44 insertions(+), 44 deletions(-) diff --git a/api/spec/requests/spree/api/addresses_spec.rb b/api/spec/requests/spree/api/addresses_spec.rb index 1babcb792e0..5639ccc44bb 100644 --- a/api/spec/requests/spree/api/addresses_spec.rb +++ b/api/spec/requests/spree/api/addresses_spec.rb @@ -32,7 +32,7 @@ module Spree::Api expect(json_response['error']).not_to be_nil expect(json_response['errors']).not_to be_nil - expect(json_response['errors']['address1'].first).to eq "can't be blank" + expect(json_response['errors']['address1'].first).to eq "can’t be blank" end end end diff --git a/api/spec/requests/spree/api/checkouts_spec.rb b/api/spec/requests/spree/api/checkouts_spec.rb index 193db21ad59..23d9db61c54 100644 --- a/api/spec/requests/spree/api/checkouts_spec.rb +++ b/api/spec/requests/spree/api/checkouts_spec.rb @@ -175,7 +175,7 @@ module Spree::Api put spree.api_checkout_path(order.to_param), params: { order_token: order.guest_token, order: { payments_attributes: [{ payment_method_id: @payment_method.id }] } } expect(response.status).to eq(422) source_errors = json_response['errors']['payments.source'] - expect(source_errors).to include("can't be blank") + expect(source_errors).to include("can’t be blank") end describe 'setting the payment amount' do @@ -252,10 +252,10 @@ module Spree::Api expect(response.status).to eq(422) cc_errors = json_response['errors']['payments.Credit Card'] - expect(cc_errors).to include("Card Number can't be blank") + expect(cc_errors).to include("Card Number can’t be blank") expect(cc_errors).to include("Month is not a number") expect(cc_errors).to include("Year is not a number") - expect(cc_errors).to include("Verification Value can't be blank") + expect(cc_errors).to include("Verification Value can’t be blank") end end diff --git a/api/spec/requests/spree/api/orders_spec.rb b/api/spec/requests/spree/api/orders_spec.rb index 4ca347a2abb..93c58cb59e1 100644 --- a/api/spec/requests/spree/api/orders_spec.rb +++ b/api/spec/requests/spree/api/orders_spec.rb @@ -613,7 +613,7 @@ module Spree::Api expect(json_response['error']).not_to be_nil expect(json_response['errors']).not_to be_nil - expect(json_response['errors']['bill_address.city'].first).to eq "can't be blank" + expect(json_response['errors']['bill_address.city'].first).to eq "can’t be blank" end it "can add shipping address" do @@ -633,7 +633,7 @@ module Spree::Api expect(json_response['error']).not_to be_nil expect(json_response['errors']).not_to be_nil - expect(json_response['errors']['ship_address.city'].first).to eq "can't be blank" + expect(json_response['errors']['ship_address.city'].first).to eq "can’t be blank" end it "cannot set the user_id for the order" do diff --git a/api/spec/requests/spree/api/payments_spec.rb b/api/spec/requests/spree/api/payments_spec.rb index 5b323abd51c..2c23967a095 100644 --- a/api/spec/requests/spree/api/payments_spec.rb +++ b/api/spec/requests/spree/api/payments_spec.rb @@ -63,7 +63,7 @@ module Spree::Api post spree.api_order_payments_path(order), params: { payment: { payment_method_id: Spree::PaymentMethod.first.id, amount: 50 } } expect(response.status).to eq(422) expect(json_response['error']).to eq("Invalid resource. Please fix errors and try again.") - expect(json_response['errors']['source']).to eq(["can't be blank"]) + expect(json_response['errors']['source']).to eq(["can’t be blank"]) end end diff --git a/api/spec/requests/spree/api/products_spec.rb b/api/spec/requests/spree/api/products_spec.rb index 1c4b2f6f365..1e811d60419 100644 --- a/api/spec/requests/spree/api/products_spec.rb +++ b/api/spec/requests/spree/api/products_spec.rb @@ -395,7 +395,7 @@ module Spree::Api put spree.api_product_path(product), params: { product: { name: "" } } expect(response.status).to eq(422) expect(json_response["error"]).to eq("Invalid resource. Please fix errors and try again.") - expect(json_response["errors"]["name"]).to eq(["can't be blank"]) + expect(json_response["errors"]["name"]).to eq(["can’t be blank"]) end # Regression test for https://github.com/spree/spree/issues/4123 diff --git a/backend/app/views/spree/admin/style_guide/topics/forms/_validation.html.erb b/backend/app/views/spree/admin/style_guide/topics/forms/_validation.html.erb index 2775138f50d..c46aa207655 100644 --- a/backend/app/views/spree/admin/style_guide/topics/forms/_validation.html.erb +++ b/backend/app/views/spree/admin/style_guide/topics/forms/_validation.html.erb @@ -9,13 +9,13 @@

2 errors prohibited this record from being saved:

There were problems with the following fields:

- can't be blank + can’t be blank
diff --git a/backend/spec/controllers/spree/admin/promotions_controller_spec.rb b/backend/spec/controllers/spree/admin/promotions_controller_spec.rb index a381288bd76..29be487cee4 100644 --- a/backend/spec/controllers/spree/admin/promotions_controller_spec.rb +++ b/backend/spec/controllers/spree/admin/promotions_controller_spec.rb @@ -118,7 +118,7 @@ it "sets the flash error" do subject - expect(flash[:error]).to eq "Name can't be blank" + expect(flash[:error]).to eq "Name can’t be blank" end it "renders new" do diff --git a/backend/spec/features/admin/configuration/payment_methods_spec.rb b/backend/spec/features/admin/configuration/payment_methods_spec.rb index f023ed48ef2..5829c82293f 100644 --- a/backend/spec/features/admin/configuration/payment_methods_spec.rb +++ b/backend/spec/features/admin/configuration/payment_methods_spec.rb @@ -90,7 +90,7 @@ it "should display validation errors" do fill_in "payment_method_name", with: "" click_button "Update" - expect(page).to have_content("Name can't be blank") + expect(page).to have_content("Name can’t be blank") end context 'with payment method having hash and array as preference' do diff --git a/backend/spec/features/admin/configuration/store_spec.rb b/backend/spec/features/admin/configuration/store_spec.rb index 42ae940c51c..12823fe3602 100644 --- a/backend/spec/features/admin/configuration/store_spec.rb +++ b/backend/spec/features/admin/configuration/store_spec.rb @@ -52,7 +52,7 @@ fill_in "Site Name", with: " " click_button "Update" - expect(page).to have_content("can't be blank") + expect(page).to have_content("can’t be blank") expect(page).to have_field("Site Name", with: " ") end end diff --git a/backend/spec/features/admin/configuration/tax_categories_spec.rb b/backend/spec/features/admin/configuration/tax_categories_spec.rb index f172c2f3a5e..3216a20fffe 100644 --- a/backend/spec/features/admin/configuration/tax_categories_spec.rb +++ b/backend/spec/features/admin/configuration/tax_categories_spec.rb @@ -40,7 +40,7 @@ it "should show validation errors if there are any" do click_button "Create" - expect(page).to have_content("Name can't be blank") + expect(page).to have_content("Name can’t be blank") end end diff --git a/backend/spec/features/admin/configuration/taxonomies_spec.rb b/backend/spec/features/admin/configuration/taxonomies_spec.rb index d012f2aeecd..eceea96b79c 100644 --- a/backend/spec/features/admin/configuration/taxonomies_spec.rb +++ b/backend/spec/features/admin/configuration/taxonomies_spec.rb @@ -36,7 +36,7 @@ it "should display validation errors" do fill_in "taxonomy_name", with: "" click_button "Create" - expect(page).to have_content("can't be blank") + expect(page).to have_content("can’t be blank") end it "disables the button at submit", :js do diff --git a/backend/spec/features/admin/orders/adjustments_spec.rb b/backend/spec/features/admin/orders/adjustments_spec.rb index 57356ed9776..bfd79e5c27d 100644 --- a/backend/spec/features/admin/orders/adjustments_spec.rb +++ b/backend/spec/features/admin/orders/adjustments_spec.rb @@ -72,7 +72,7 @@ fill_in "adjustment_amount", with: "" fill_in "adjustment_label", with: "" click_button "Continue" - expect(page).to have_content("Label can't be blank") + expect(page).to have_content("Label can’t be blank") expect(page).to have_content("Amount is not a number") end end @@ -105,7 +105,7 @@ fill_in "adjustment_amount", with: "" fill_in "adjustment_label", with: "" click_button "Continue" - expect(page).to have_content("Label can't be blank") + expect(page).to have_content("Label can’t be blank") expect(page).to have_content("Amount is not a number") end end diff --git a/backend/spec/features/admin/orders/customer_details_spec.rb b/backend/spec/features/admin/orders/customer_details_spec.rb index 264fddafa3c..c5ad3f3b68c 100644 --- a/backend/spec/features/admin/orders/customer_details_spec.rb +++ b/backend/spec/features/admin/orders/customer_details_spec.rb @@ -119,7 +119,7 @@ order.update!(ship_address_id: nil) click_link "Customer" click_button "Update" - expect(page).to have_content("Shipping address name can't be blank") + expect(page).to have_content("Shipping address name can’t be blank") end context "for an order in confirm state with a user" do diff --git a/backend/spec/features/admin/orders/payments_spec.rb b/backend/spec/features/admin/orders/payments_spec.rb index 39dc4dd6f06..5709eed0a1e 100644 --- a/backend/spec/features/admin/orders/payments_spec.rb +++ b/backend/spec/features/admin/orders/payments_spec.rb @@ -215,9 +215,9 @@ it "is unable to create a new payment with invalid information" do click_button "Continue" expect(page).to have_content("Payment could not be created.") - expect(page).to have_content("Number can't be blank") - expect(page).to have_content("Name can't be blank") - expect(page).to have_content("Verification Value can't be blank") + expect(page).to have_content("Number can’t be blank") + expect(page).to have_content("Name can’t be blank") + expect(page).to have_content("Verification Value can’t be blank") expect(page).to have_content("Month is not a number") expect(page).to have_content("Year is not a number") end diff --git a/backend/spec/features/admin/products/edit/products_spec.rb b/backend/spec/features/admin/products/edit/products_spec.rb index 5af44051524..ddfdc4c9111 100644 --- a/backend/spec/features/admin/products/edit/products_spec.rb +++ b/backend/spec/features/admin/products/edit/products_spec.rb @@ -42,7 +42,7 @@ fill_in "product_slug", with: '' click_button "Update" - within('#product_slug_field') { expect(page).to have_content("can't be blank") } + within('#product_slug_field') { expect(page).to have_content("can’t be blank") } fill_in "product_slug", with: 'x' click_button "Update" diff --git a/backend/spec/features/admin/products/products_spec.rb b/backend/spec/features/admin/products/products_spec.rb index bb11bc15ca8..095dc3a35e0 100644 --- a/backend/spec/features/admin/products/products_spec.rb +++ b/backend/spec/features/admin/products/products_spec.rb @@ -216,7 +216,7 @@ def build_option_type_with_values(name, values) fill_in "product_sku", with: "B100" fill_in "product_price", with: "100" click_button "Create" - expect(page).to have_content("Shipping category can't be blank") + expect(page).to have_content("Shipping category can’t be blank") end context "using a locale with a different decimal format " do @@ -251,7 +251,7 @@ def build_option_type_with_values(name, values) select @shipping_category.name, from: "product_shipping_category_id" fill_in "product_price", with: "19,99" click_button "Create" - expect(page).to have_content("Name can't be blank") + expect(page).to have_content("Name can’t be blank") expect(page).to have_field('product_price', with: '19,99') end end diff --git a/backend/spec/features/admin/products/properties_spec.rb b/backend/spec/features/admin/products/properties_spec.rb index 4a75ec84a58..cf5d4ace209 100644 --- a/backend/spec/features/admin/products/properties_spec.rb +++ b/backend/spec/features/admin/products/properties_spec.rb @@ -72,7 +72,7 @@ it "should show validation errors" do fill_in "property_name", with: "" click_button "Update" - expect(page).to have_content("Name can't be blank") + expect(page).to have_content("Name can’t be blank") end end diff --git a/backend/spec/features/admin/promotions/promotion_categories_spec.rb b/backend/spec/features/admin/promotions/promotion_categories_spec.rb index 1457f53055d..260492b3212 100644 --- a/backend/spec/features/admin/promotions/promotion_categories_spec.rb +++ b/backend/spec/features/admin/promotions/promotion_categories_spec.rb @@ -44,7 +44,7 @@ fill_in "promotion_category_name", with: "" fill_in "promotion_category_code", with: "prtest" click_button "Create" - expect(page).to have_content("Name can't be blank") + expect(page).to have_content("Name can’t be blank") end end @@ -65,7 +65,7 @@ it "should show validation errors" do fill_in "promotion_category_name", with: "" click_button "Update" - expect(page).to have_content("Name can't be blank") + expect(page).to have_content("Name can’t be blank") end end diff --git a/core/spec/lib/calculated_adjustments_spec.rb b/core/spec/lib/calculated_adjustments_spec.rb index 8d10940b639..7cc2ae6fd46 100644 --- a/core/spec/lib/calculated_adjustments_spec.rb +++ b/core/spec/lib/calculated_adjustments_spec.rb @@ -45,7 +45,7 @@ class Calculable < ActiveRecord::Base it 'is not valid' do expect(subject).not_to be_valid - expect(subject.errors[:calculator]).to eq ["can't be blank"] + expect(subject.errors[:calculator]).to eq ["can’t be blank"] end end diff --git a/core/spec/models/spree/address/state_validator_spec.rb b/core/spec/models/spree/address/state_validator_spec.rb index d3c2d8b0faa..c9059ab92db 100644 --- a/core/spec/models/spree/address/state_validator_spec.rb +++ b/core/spec/models/spree/address/state_validator_spec.rb @@ -117,7 +117,7 @@ subject - expect(address.errors.messages).to eq({ state: ["can't be blank"] }) + expect(address.errors.messages).to eq({ state: ["can’t be blank"] }) end context "state country doesn't match the address' country" do diff --git a/core/spec/models/spree/address_spec.rb b/core/spec/models/spree/address_spec.rb index a17af6f1d57..a53d4bc3af1 100644 --- a/core/spec/models/spree/address_spec.rb +++ b/core/spec/models/spree/address_spec.rb @@ -29,20 +29,20 @@ address.state = nil address.state_name = nil expect(address.valid?).to eq(false) - expect(address.errors['state']).to eq(["can't be blank"]) + expect(address.errors['state']).to eq(["can’t be blank"]) end end it "requires phone" do address.phone = "" address.valid? - expect(address.errors["phone"]).to eq(["can't be blank"]) + expect(address.errors["phone"]).to eq(["can’t be blank"]) end it "requires zipcode" do address.zipcode = "" address.valid? - expect(address.errors['zipcode']).to include("can't be blank") + expect(address.errors['zipcode']).to include("can’t be blank") end context "phone not required" do diff --git a/core/spec/models/spree/adjustment_spec.rb b/core/spec/models/spree/adjustment_spec.rb index b50af5ac879..579e103d023 100644 --- a/core/spec/models/spree/adjustment_spec.rb +++ b/core/spec/models/spree/adjustment_spec.rb @@ -196,7 +196,7 @@ context "when the promotion has a code" do let!(:promotion_code) { create(:promotion_code, promotion: promotion) } - it { is_expected.to include("can't be blank") } + it { is_expected.to include("can’t be blank") } end end diff --git a/core/spec/models/spree/credit_card_spec.rb b/core/spec/models/spree/credit_card_spec.rb index cb567c87687..81587f1dd8b 100644 --- a/core/spec/models/spree/credit_card_spec.rb +++ b/core/spec/models/spree/credit_card_spec.rb @@ -42,13 +42,13 @@ def self.payment_states it "should validate presence of number" do credit_card.attributes = valid_credit_card_attributes.except(:number) expect(credit_card).not_to be_valid - expect(credit_card.errors[:number]).to eq(["can't be blank"]) + expect(credit_card.errors[:number]).to eq(["can’t be blank"]) end it "should validate presence of security code" do credit_card.attributes = valid_credit_card_attributes.except(:verification_value) expect(credit_card).not_to be_valid - expect(credit_card.errors[:verification_value]).to eq(["can't be blank"]) + expect(credit_card.errors[:verification_value]).to eq(["can’t be blank"]) end it "validates name presence" do diff --git a/core/spec/models/spree/fulfilment_changer_spec.rb b/core/spec/models/spree/fulfilment_changer_spec.rb index b850d2d4af7..60eed2fc546 100644 --- a/core/spec/models/spree/fulfilment_changer_spec.rb +++ b/core/spec/models/spree/fulfilment_changer_spec.rb @@ -374,7 +374,7 @@ it "has an activemodel error hash" do subject - expect(shipment_splitter.errors.messages).to eq(desired_stock_location: ["can't be blank"]) + expect(shipment_splitter.errors.messages).to eq(desired_stock_location: ["can’t be blank"]) end end @@ -434,7 +434,7 @@ it "has an activemodel error hash" do subject - expect(shipment_splitter.errors.messages).to eq(desired_stock_location: ["can't be blank"]) + expect(shipment_splitter.errors.messages).to eq(desired_stock_location: ["can’t be blank"]) end end end diff --git a/core/spec/models/spree/order/validations_spec.rb b/core/spec/models/spree/order/validations_spec.rb index 4920077f49b..da75e8ebea4 100644 --- a/core/spec/models/spree/order/validations_spec.rb +++ b/core/spec/models/spree/order/validations_spec.rb @@ -10,7 +10,7 @@ module Spree order = Spree::Order.new allow(order).to receive_messages(email_required?: true) order.valid? - expect(order.errors[:email]).to eq(["can't be blank"]) + expect(order.errors[:email]).to eq(["can’t be blank"]) end end end diff --git a/core/spec/models/spree/order_promotion_spec.rb b/core/spec/models/spree/order_promotion_spec.rb index a2aaadd7fd7..a56e72dff01 100644 --- a/core/spec/models/spree/order_promotion_spec.rb +++ b/core/spec/models/spree/order_promotion_spec.rb @@ -27,7 +27,7 @@ promotion.codes << build(:promotion_code, promotion: promotion) end - it { is_expected.to include("can't be blank") } + it { is_expected.to include("can’t be blank") } end end diff --git a/core/spec/models/spree/payment_spec.rb b/core/spec/models/spree/payment_spec.rb index 820aee38edd..f61f232e43e 100644 --- a/core/spec/models/spree/payment_spec.rb +++ b/core/spec/models/spree/payment_spec.rb @@ -107,10 +107,10 @@ payment.source = Spree::CreditCard.new expect(payment).not_to be_valid cc_errors = payment.errors['Credit Card'] - expect(cc_errors).to include("Card Number can't be blank") + expect(cc_errors).to include("Card Number can’t be blank") expect(cc_errors).to include("Month is not a number") expect(cc_errors).to include("Year is not a number") - expect(cc_errors).to include("Verification Value can't be blank") + expect(cc_errors).to include("Verification Value can’t be blank") end end diff --git a/core/spec/models/spree/store_credit_event_spec.rb b/core/spec/models/spree/store_credit_event_spec.rb index d832b063bd3..aed01f147c8 100644 --- a/core/spec/models/spree/store_credit_event_spec.rb +++ b/core/spec/models/spree/store_credit_event_spec.rb @@ -55,7 +55,7 @@ it "adds an error message indicating the store credit reason is missing" do subject - expect(event.errors.full_messages).to match ["Store credit reason can't be blank"] + expect(event.errors.full_messages).to match ["Store credit reason can’t be blank"] end end end @@ -78,7 +78,7 @@ it "adds an error message indicating the store credit reason is missing" do subject - expect(event.errors.full_messages).to match ["Store credit reason can't be blank"] + expect(event.errors.full_messages).to match ["Store credit reason can’t be blank"] end end end