From 31dcd7811185134f16a52744ad50f87d197ca438 Mon Sep 17 00:00:00 2001 From: Sven Fuchs Date: Thu, 11 Sep 2008 00:35:58 +0200 Subject: add activerecord tests for deprecation of %s and %d in error messages (and translations in general) Signed-off-by: Jeremy Kemper --- activerecord/test/cases/validations_i18n_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'activerecord') 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 -- cgit v1.2.3