Hi All
I am trying to setup a cucumber test framework which tests an
application which uses a mongodb, and I have installed the mongodb and
the I am using Mongoid as my ORM. And this is what the structure looks
like.
.
├── Gemfile
├── Gemfile.lock
├── config
│ └── mongoid.yml
├── features
│ ├── fruit_list.feature
│ ├── lib
│ │ └── fruit_app.rb
│ ├── step_definitions
│ └── support
│ ├── env.rb
│ └── hooks.rb
└── spec
6 directories, 7 files
However my configuration is not right because is failing:
mongoid.yml
development:
sessions:
default:
database: test_mongo_db
hosts:
- localhost:27017
env.rb
require File.join(File.dirname(FILE), ‘…’, ‘lib/fruit_app’ )
require ‘mongoid’
Mongoid.load!( File.join(File.dirname(FILE), ‘…’, ‘…’,
‘config/mongoid.yml’) , :development)
configure do
Mongoid.load!(‘config/mongoid.yml’)
end
Mongoid.configure do |config|
config.master = Mongo::Connection.new.db(“godfather”)
end
hook
require ‘database_cleaner’
DatabaseCleaner.strategy = :truncation
DatabaseCleaner.orm = “mongoid”
Before do
DatabaseCleaner.clean
end
I am not sure what I am doing wrong, can anyone help on this.
Thanks