My Minitest controller tests are working fine if I run them alone using rake minitest:controllers but when I run rake minitest:all then I get valid
If for whatever reason you don't want to add the 'minitest-around' gem (to have more than one setup and teardown method), you can do this in your test_helper.rb...
require "database_cleaner"
DatabaseCleaner.strategy = :transaction
module AroundEachTest
def before_setup
super
DatabaseCleaner.start
end
def after_teardown
super
DatabaseCleaner.clean
end
end
class Minitest::Test
include AroundEachTest
end