提交 e76379b0 编写于 作者: A Akira Matsuda

Clear validators before and after each test

Or some tests fail when run in random order
上级 9c91c168
......@@ -6,6 +6,7 @@ class I18nValidationTest < ActiveRecord::TestCase
repair_validations(Topic, Reply)
def setup
repair_validations(Topic, Reply)
Reply.validates_presence_of(:title)
@topic = Topic.new
@old_load_path, @old_backend = I18n.load_path.dup, I18n.backend
......
......@@ -13,7 +13,7 @@ def repair_validations(*model_classes)
end
def repair_validations(*model_classes)
yield
yield if block_given?
ensure
model_classes.each do |k|
k.clear_validators!
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册