spec/spec_helper.rb in mongoid_paranoia-0.2.1 vs spec/spec_helper.rb in mongoid_paranoia-0.3.0
- old
+ new
@@ -2,11 +2,10 @@
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
require "mongoid"
require "mongoid/paranoia"
require "rspec"
-Dir[File.join(File.dirname(__FILE__), "app/models/*.rb")].each{ |f| require f }
# These environment variables can be set if wanting to test against a database
# that is not on the local machine.
ENV["MONGOID_SPEC_HOST"] ||= "localhost"
ENV["MONGOID_SPEC_PORT"] ||= "27017"
@@ -31,10 +30,11 @@
ENV["MONGOHQ_REPL_PASS"].present?
end
# Set the database that the spec suite connects to.
Mongoid.configure do |config|
+ config.belongs_to_required_by_default = false
config.connect_to(database_id)
end
module Rails
class Application
@@ -53,11 +53,11 @@
Mongoid.purge!
end
config.before(:all) do
Mongoid.logger.level = Logger::INFO
- Mongo::Logger.logger.level = Logger::INFO if Mongoid::Compatibility::Version.mongoid5?
+ Mongo::Logger.logger.level = Logger::INFO
end
config.after(:all) do
Mongoid.purge!
end
@@ -69,5 +69,7 @@
end
ActiveSupport::Inflector.inflections do |inflect|
inflect.singular("address_components", "address_component")
end
+
+Dir[File.join(File.dirname(__FILE__), "app/models/*.rb")].each{ |f| require f }