Prevent rspec from trying to connect to mongoid
1 answer
For unit tests in rspec, if you make Mongoid persistence calls on model objects, you will instead need to replace those persistence calls with mock / stubbing calls. For example, factory -girl provides mock implementations of your model objects, which you can then use in your unit tests by invoking the volatility methods ala ...
person = FactoryGirl.build(:person) person.should be_a_kind_of Person
Avoid calling methods that persist in the test database, such as "FactorGirl.create"
0
source to share