aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Fuchs <svenfuchs@artweb-design.de>2008-09-11 00:35:58 +0200
committerJeremy Kemper <jeremy@bitsweat.net>2008-09-10 19:28:36 -0700
commit31dcd7811185134f16a52744ad50f87d197ca438 (patch)
treeb75dbd660db275269c64adcaf337b93771698b9c
parent79c8b104d676ce40268caaa530b7e4dcc0a8ff20 (diff)
downloadrails-31dcd7811185134f16a52744ad50f87d197ca438.tar.gz
rails-31dcd7811185134f16a52744ad50f87d197ca438.tar.bz2
rails-31dcd7811185134f16a52744ad50f87d197ca438.zip
add activerecord tests for deprecation of %s and %d in error messages (and translations in general)
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
-rw-r--r--activerecord/test/cases/validations_i18n_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/cases/validations_i18n_test.rb b/activerecord/test/cases/validations_i18n_test.rb
index 090f347a20..4d23321ede 100644
--- a/activerecord/test/cases/validations_i18n_test.rb
+++ b/activerecord/test/cases/validations_i18n_test.rb
@@ -40,6 +40,18 @@ class ActiveRecordValidationsI18nTests < Test::Unit::TestCase
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_is_deprecated
+ assert_deprecated('using %d in messages') do
+ I18n.t :does_not_exist, :default => "%d interpolation syntax is deprected", :count => 1
+ end
+ end
+
# ActiveRecord::Errors
uses_mocha 'ActiveRecord::Errors' do