silence deprecation warning during validations test

This commit is contained in:
Sven Fuchs 2008-06-23 14:55:07 +02:00
parent 77177441d1
commit 8461526f34
1 changed files with 3 additions and 1 deletions

View File

@ -853,7 +853,9 @@ class ValidationsTest < ActiveRecord::TestCase
end
def test_validates_length_with_globally_modified_error_message
ActiveRecord::Errors.default_error_messages[:too_short] = 'tu est trops petit hombre %d'
ActiveSupport::Deprecation.silence do
ActiveRecord::Errors.default_error_messages[:too_short] = 'tu est trops petit hombre %d'
end
Topic.validates_length_of :title, :minimum => 10
t = Topic.create(:title => 'too short')
assert !t.valid?