This category contains 3 posts

Tutorial: Using Cucumber testing with MongoDB

This example is based on the following tutorial http://www.mongodb.org/display/DOCS/MongoDB+Data+Modeling+and+Rails. I recommend reading it to get familiar with how MongoDB is integrated with a Rails application. I rewrote the project using the TDD approach with Cucumber and the source code can be found on github 1. First of all, create a mock application with suspenders. gem … Continue reading

Factory Girl associations with MongoMapper

If you have an association (an Article belonging to a User) and you write something like that in Cucumber: Given the following article exists: | title | user | | My article | email: writer1@example.com | then the Factory Girl steps will handle this association for you, creating both an Article and a User for … Continue reading

Association testing in rspec with MongoMapper

As far as I know, MongoMapper is currently not able to handle association tests for rspec/shoulda, such as most common belongs_to, has_many, has_one. I think they are working on it, but it’s not there yet. I wrote a hack to work with MongoMapper, so far it’s able to handle my simple belongs_to association, and my … Continue reading