RSpec with Mongoid
mongoid-rspec provide several RSpec matchers and macros for Mongoid.
If you are using the new master branch of Mongoid (which is my case), probably you are facing this error when try to run your specs (
no such file to load -- mongoid/associations (LoadError)
This is because the new master branch of Mongoid has deleted the file
mongoid/associations. You need use the safe_master branch. Or you can try to use this fork of Mongoid-rspec compatible with Mongoid 2.0.0.rc1:
To do this, just add this gem to your gemfile:
gem 'mongoid-rspec', :git => 'git://github.com/shingara/mongoid-rspec.git', :branch => 'mongoid-2.0.0.rc1'