aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2014-01-27 10:58:54 -0800
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2014-01-27 10:58:54 -0800
commit5e5af5b67ac9de64035351e5da5cb3ddb779813b (patch)
tree29cde4a968792d8e4bd4f150270a3aa8b41f2cca /activerecord
parentd57ce232a885b21e1d6d1f9fbf60bc5908ad880d (diff)
parent20317f3d4df3ef0e876b5b213551f0d7d81d0c19 (diff)
downloadrails-5e5af5b67ac9de64035351e5da5cb3ddb779813b.tar.gz
rails-5e5af5b67ac9de64035351e5da5cb3ddb779813b.tar.bz2
rails-5e5af5b67ac9de64035351e5da5cb3ddb779813b.zip
Merge pull request #13855 from kuldeepaggarwal/reset_validators
use the new clear_validators! api everywhere to reset validators in tests
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/test/cases/persistence_test.rb4
-rw-r--r--activerecord/test/cases/validations/i18n_generate_message_validation_test.rb2
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