aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Fuchs <svenfuchs@artweb-design.de>2008-09-11 00:39:56 +0200
committerJeremy Kemper <jeremy@bitsweat.net>2008-09-10 19:28:36 -0700
commite826c992014b24475203bf1a88b3f7a2356f7ff5 (patch)
treeb5b6ffff442afb6c4a39888bc22c87eb2fa8887c
parent31dcd7811185134f16a52744ad50f87d197ca438 (diff)
downloadrails-e826c992014b24475203bf1a88b3f7a2356f7ff5.tar.gz
rails-e826c992014b24475203bf1a88b3f7a2356f7ff5.tar.bz2
rails-e826c992014b24475203bf1a88b3f7a2356f7ff5.zip
add activerecord tests to make sure the deprecated %s and %d interpolation syntax still works
[#1016 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
-rw-r--r--activerecord/test/cases/validations_i18n_test.rb16
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