Skip to content

Commit

Permalink
Merge pull request #13855 from kuldeepaggarwal/reset_validators
Browse files Browse the repository at this point in the history
use the new clear_validators! api everywhere to reset validators in tests
  • Loading branch information
carlosantoniodasilva committed Jan 27, 2014
2 parents d57ce23 + 20317f3 commit 5e5af5b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Expand Up @@ -63,6 +63,6 @@ def test_validates_acceptance_of_for_ruby_class
p.karma = "1"
assert p.valid?
ensure
Person.reset_callbacks(:validate)
Person.clear_validators!
end
end
4 changes: 2 additions & 2 deletions activerecord/test/cases/persistence_test.rb
Expand Up @@ -740,7 +740,7 @@ def test_update!

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!
Expand All @@ -761,7 +761,7 @@ def test_update_attributes!

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
Expand Down
Expand Up @@ -3,7 +3,7 @@

class I18nGenerateMessageValidationTest < ActiveRecord::TestCase
def setup
Topic.reset_callbacks(:validate)
Topic.clear_validators!
@topic = Topic.new
I18n.backend = I18n::Backend::Simple.new
end
Expand Down

0 comments on commit 5e5af5b

Please sign in to comment.