I am trying to set up cleaning of my specs using database_cleaner gem. I have the following simple config in my spec_helper.rb:
require 'database_cleaner'
RSpec.configure do |config|
config.use_transactional_fixtures = false
config.before :suite do
DatabaseCleaner.strategy = :truncation
end
config.before :each do
DatabaseCleaner.start
end
config.after :each do
DatabaseCleaner.clean
end
end
Running the spec though, I'm noticing that my database gets completely wiped out after DatabaseCleaner.clean is executed. I'm sure it's meant to clean up only the effects of the test... Any ideas what may cause such behavior?