h2. Rails UnitTest ==== in file in @class ActiveSupport::TestCase@ add teardown :clean_mongodb def clean_mongodb puts cleaning mongodb....Rails UnitTest in file test/test_helper.rb in class ActiveSupport::TestCase add teardown :clean_mongodb def clean_mongodb puts "cleaning mongodb...." Mongoid.database.collections.each do |collection| unless collection.name =~ /^system\./ collection.remove