Factory girl is an object factory library to be used with your tests. Installation: $ [sudo] gem install factory_girl or with Rails >2.1 dependency management, add to environment.rb config.gem "factory_girl", :lib => false Then add: require 'factory_girl' to your test_helper.rb or spec_helper.rb Defining factories: # This will guess the User class Factory.define :user do |u| u.first_name 'John' u.