diff options
author | Kuldeep Aggarwal <kd.engineer@yahoo.co.in> | 2014-01-28 00:13:35 +0530 |
---|---|---|
committer | Kuldeep Aggarwal <kd.engineer@yahoo.co.in> | 2014-01-28 00:13:35 +0530 |
commit | 20317f3d4df3ef0e876b5b213551f0d7d81d0c19 (patch) | |
tree | 29cde4a968792d8e4bd4f150270a3aa8b41f2cca /activerecord/test | |
parent | d57ce232a885b21e1d6d1f9fbf60bc5908ad880d (diff) | |
download | rails-20317f3d4df3ef0e876b5b213551f0d7d81d0c19.tar.gz rails-20317f3d4df3ef0e876b5b213551f0d7d81d0c19.tar.bz2 rails-20317f3d4df3ef0e876b5b213551f0d7d81d0c19.zip |
use the new clear_validators! api everywhere to reset validators in tests
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/persistence_test.rb | 4 | ||||
-rw-r--r-- | activerecord/test/cases/validations/i18n_generate_message_validation_test.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/test/cases/persistence_test.rb b/activerecord/test/cases/persistence_test.rb index 6f1e518f45..b9f0624f76 100644 --- a/activerecord/test/cases/persistence_test.rb +++ b/activerecord/test/cases/persistence_test.rb @@ -740,7 +740,7 @@ class PersistenceTest < ActiveRecord::TestCase assert_raise(ActiveRecord::RecordInvalid) { reply.update!(title: nil, content: "Have a nice evening") } ensure - Reply.reset_callbacks(:validate) + Reply.clear_validators! end def test_update_attributes! @@ -761,7 +761,7 @@ class PersistenceTest < ActiveRecord::TestCase assert_raise(ActiveRecord::RecordInvalid) { reply.update_attributes!(title: nil, content: "Have a nice evening") } ensure - Reply.reset_callbacks(:validate) + Reply.clear_validators! end def test_destroyed_returns_boolean diff --git a/activerecord/test/cases/validations/i18n_generate_message_validation_test.rb b/activerecord/test/cases/validations/i18n_generate_message_validation_test.rb index a73c3bf1af..13d4d85afa 100644 --- a/activerecord/test/cases/validations/i18n_generate_message_validation_test.rb +++ b/activerecord/test/cases/validations/i18n_generate_message_validation_test.rb @@ -3,7 +3,7 @@ require 'models/topic' class I18nGenerateMessageValidationTest < ActiveRecord::TestCase def setup - Topic.reset_callbacks(:validate) + Topic.clear_validators! @topic = Topic.new I18n.backend = I18n::Backend::Simple.new end |