1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #13855 from kuldeepaggarwal/reset_validators

use the new clear_validators! api everywhere to reset validators in tests
This commit is contained in:
Carlos Antonio da Silva 2014-01-27 10:58:54 -08:00
commit 5e5af5b67a
3 changed files with 4 additions and 4 deletions

View file

@ -63,6 +63,6 @@ class AcceptanceValidationTest < ActiveModel::TestCase
p.karma = "1"
assert p.valid?
ensure
Person.reset_callbacks(:validate)
Person.clear_validators!
end
end

View file

@ -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

View file

@ -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