spec/spec_helper.rb in mongoid_token-2.0.2 vs spec/spec_helper.rb in mongoid_token-2.1.0

- old
+ new

@@ -1,19 +1,17 @@ +require "codeclimate-test-reporter" +CodeClimate::TestReporter.start + $: << File.expand_path("../../lib", __FILE__) require 'database_cleaner' require 'mongoid' require 'mongoid-rspec' require 'mongoid_token' ENV['MONGOID_ENV'] = "test" -class Document - include Mongoid::Document - include Mongoid::Token -end - RSpec.configure do |config| config.include Mongoid::Matchers config.before(:suite) do DatabaseCleaner.strategy = :truncation end @@ -22,6 +20,14 @@ DatabaseCleaner.clean Mongoid.purge! end end -Mongoid.load!( File.join(File.dirname(__FILE__), 'mongoid.yml') ) +Mongoid.configure do |config| + config.sessions = { + default: { + database: "mongoid_token_test", + hosts: [ "localhost:#{ENV['BOXEN_MONGODB_PORT'] || 27017}" ], + options: {} + } + } +end