diff options
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/validations_i18n_test.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/activerecord/test/cases/validations_i18n_test.rb b/activerecord/test/cases/validations_i18n_test.rb index 4d23321ede..e34890ef19 100644 --- a/activerecord/test/cases/validations_i18n_test.rb +++ b/activerecord/test/cases/validations_i18n_test.rb @@ -40,15 +40,29 @@ class ActiveRecordValidationsI18nTests < Test::Unit::TestCase end end + def test_percent_s_interpolation_syntax_in_error_messages_still_works + ActiveSupport::Deprecation.silence do + result = I18n.t :does_not_exist, :default => "%s interpolation syntax is deprecated", :value => 'this' + assert_equal result, "this interpolation syntax is deprecated" + end + end + def test_percent_s_interpolation_syntax_in_error_messages_is_deprecated assert_deprecated('using %s in messages') do I18n.t :does_not_exist, :default => "%s interpolation syntax is deprected", :value => 'this' end end + def test_percent_d_interpolation_syntax_in_error_messages_still_works + ActiveSupport::Deprecation.silence do + result = I18n.t :does_not_exist, :default => "%d interpolation syntaxes are deprecated", :count => 2 + assert_equal result, "2 interpolation syntaxes are deprecated" + end + end + def test_percent_d_interpolation_syntax_in_error_messages_is_deprecated assert_deprecated('using %d in messages') do - I18n.t :does_not_exist, :default => "%d interpolation syntax is deprected", :count => 1 + I18n.t :does_not_exist, :default => "%d interpolation syntaxes are deprected", :count => 2 end end |