From 5196991866ab38be8a9501849cd9a5dfa6f624cd Mon Sep 17 00:00:00 2001 From: Heitor Cardozo Date: Fri, 17 Mar 2023 10:02:05 -0300 Subject: [PATCH 1/2] fix: errors.format for allow_value_matcher --- lib/shoulda/matchers/active_model/allow_value_matcher.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/shoulda/matchers/active_model/allow_value_matcher.rb b/lib/shoulda/matchers/active_model/allow_value_matcher.rb index 023e0833b..f2bc6552d 100644 --- a/lib/shoulda/matchers/active_model/allow_value_matcher.rb +++ b/lib/shoulda/matchers/active_model/allow_value_matcher.rb @@ -612,7 +612,7 @@ def inspected_values_to_set def default_expected_message if expects_strict? - "#{human_attribute_name} #{default_attribute_message}" + I18n.t(:"errors.format", attribute: human_attribute_name, message: default_attribute_message) else default_attribute_message end From bdd1b8fc62fcaf3cf7ed0a0248717f2a1f58cdc0 Mon Sep 17 00:00:00 2001 From: Heitor Cardozo Date: Fri, 17 Mar 2023 10:30:08 -0300 Subject: [PATCH 2/2] fix: solve lint problems --- lib/shoulda/matchers/active_model/allow_value_matcher.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/shoulda/matchers/active_model/allow_value_matcher.rb b/lib/shoulda/matchers/active_model/allow_value_matcher.rb index f2bc6552d..5a57f54da 100644 --- a/lib/shoulda/matchers/active_model/allow_value_matcher.rb +++ b/lib/shoulda/matchers/active_model/allow_value_matcher.rb @@ -612,7 +612,8 @@ def inspected_values_to_set def default_expected_message if expects_strict? - I18n.t(:"errors.format", attribute: human_attribute_name, message: default_attribute_message) + I18n.t(:"errors.format", attribute: human_attribute_name, + message: default_attribute_message,) else default_attribute_message end