From be3e33b93ad01f0f624117acbf217a9e3d396863 Mon Sep 17 00:00:00 2001 From: Sven Fuchs Date: Thu, 11 Sep 2008 00:35:58 +0200 Subject: [PATCH] add activerecord tests for deprecation of %s and %d in error messages (and translations in general) --- activerecord/test/cases/validations_i18n_test.rb | 12 ++++++++++++ 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 090f347..4d23321 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 -- 1.5.3.7