require 'database_cleaner' RSpec.configure do |config| config.before(:suite) do DatabaseCleaner[:mongoid].strategy = :truncation DatabaseCleaner.clean_with(:truncation) end config.before(:each) do DatabaseCleaner[:mongoid].start end config.after(:each) do DatabaseCleaner[:mongoid].clean end end