How can I clean my database between erroneous rspec specs?
问题 I have added the database_cleaner gem to my rails application in order to clean my database between specs. Here's my current configuration for database_cleaner, located in spec/spec_helper.rb : config.before(:suite) do DatabaseCleaner.strategy = :transaction DatabaseCleaner.clean_with(:truncation) DatabaseCleaner.start DatabaseCleaner.clean end config.before(:each) do DatabaseCleaner.clean end config.after(:each) do DatabaseCleaner.clean end config.after(:suite) do DatabaseCleaner.clean end