Permalink
Browse files

add activerecord tests to make sure the deprecated %s and %d interpol…

…ation syntax still works

[#1016 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information...
1 parent 31dcd78 commit e826c992014b24475203bf1a88b3f7a2356f7ff5 Sven Fuchs committed with jeremy Sep 10, 2008
Showing with 15 additions and 1 deletion.
  1. +15 −1 activerecord/test/cases/validations_i18n_test.rb
@@ -40,15 +40,29 @@ def test_default_error_messages_is_deprecated
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

0 comments on commit e826c99

Please sign in to comment.