Why Factory Girl:

  • Fixtures separates the data we are testing with actual behavior
  • Makes tests brittle and you have to look at fixture files to understand the tests, which is certainly not the intent for the tests
  • Its painful to have fixtures maintained for each model
  • You have to keep switching between files to see what fixtures there are, always struggling with dependencies and conflicts

How to get started:

  • gem install thoughtbot-factory_girl –source http://gems.github.com
  • Add the following code to your test environment file —>
config.gem “thoughtbot-factory_girl”, :lib => “factory_girl”, :source => http://gems.github.com