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
rake minitest:controllers
rake minitest:all
You can DRY up that repetition with this
DatabaseCleaner.strategy = :truncation class MiniTest::Spec before :each do DatabaseCleaner.clean end end
This example subclasses the spec runner, but you can pick your test environment of choice.