spec/spec_helper.rb in mongoid_token-1.0.0 vs spec/spec_helper.rb in mongoid_token-1.1.0

- old
+ new

@@ -4,28 +4,20 @@ require 'mongoid' require 'mongoid-rspec' require 'mongoid_token' require 'mongoid/token/exceptions' +ENV['MONGOID_ENV'] = "test" + RSpec.configure do |config| config.include Mongoid::Matchers config.before(:suite) do DatabaseCleaner.strategy = :truncation end config.after(:each) do DatabaseCleaner.clean - - # Added dropping collection to ensure indexes are removed - Mongoid.master.collections.select do |collection| - include = collection.name !~ /system/ - include - end.each(&:drop) + Mongoid.purge! end end -Mongoid.configure do |config| - config.master = Mongo::Connection.new.db("mongoid_token_test") - config.autocreate_indexes = true - config.persist_in_safe_mode = true -end - +Mongoid.load!( File.join(File.dirname(__FILE__), 'mongoid.yml') )