Installation

Leif Ringstad edited this page Nov 1, 2017 · 15 revisions

Rails 3 Installation:

See the factory_bot_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_bot"

Then:

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

Sinatra Intallation

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

FactoryBot.definition_file_paths = %w{./factories ./test/factories ./spec/factories}
FactoryBot.find_definitions

Padrino Installation

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

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

JRuby Installation

FactoryBot requires ruby 1.9 compatibility mode.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.