I have been successfully using mongoid for some time time now in the
development environment.
However, when trying to run rspec test, I get the following messgae.
rspec user_spec.rb
allow_dynamic_fields is not a valid option for Mongo::Connection
yadda, yadda, yadda, (lots of invalid options listed herr)...
use_utc is not a valid option for Mongo::Connection
MONGODB [DEBUG] Logging level is currently :debug which could
negatively impact client-side performance. You should set your logging
level no lower than :info in production.
MONGODB (0ms) admin['$cmd'].find({:ismaster=>1}).limit(-1)
F
Failures:
1) User automatically creates a new Account, when it is created with
role of User::ROLE_PRIMARY_ACCOUNT_ADMIN
Failure/Error: u = User.create firstname: 'Tom', lastname:
'Hanks', email: '
to...@gmail.com', roles:
[User::ROLE_PRIMARY_ACCOUNT_ADMIN], password: 'pass'
TypeError:
db_name must be a string or symbol # it is nil!
# ./user_spec.rb:11:in `block (2 levels) in <top (required)>'
Well fro the error messages about the invalid options, it appears that
the test code can connect to the database.
By putting a print statement in relevant rb file in the gem, I can see
that the db_name is nil.
my mongoid.yml file looks like this:
development:
host: localhost
database: cmf_development
test:
host: localhost
database: cmf_test
Any suggestions as to how to fix this?