Skip to content
dougalmacpherson edited this page Feb 16, 2012 · 10 revisions

Rails 3 Installation:

See the factory_girl_rails repo README.

Rails 2 Installation:

Installation is a snap (for Rails, you’ll want to add this in config/environments/test.rb):

config.gem "factory_girl"

Then:

rake gems:install RAILS_ENV=test
rake gems:unpack RAILS_ENV=test

Padrino Installation

If you’re using rpsec, add to spec/spec_helper.rb

FactoryGirl.definition_file_paths = [
    File.join(Padrino.root, 'factories'),
    File.join(Padrino.root, 'test', 'factories'),
    File.join(Padrino.root, 'spec', 'factories')
]
FactoryGirl.find_definitions