Although I cannot imagine why you can do this, perhaps you can try this: https://github.com/bmabey/database_cleaner
In any case, instructions that can be called before each test should be placed in a call to configure:
setup do
end
UPDATE . To explain a little more:
One thing you can do is inside your file test_helper.rb:
class ActiveSupport::TestCase
setup do
end
end
, , ActiveSupport::TestCase, require 'test_helper'.
, , - , .
, ?