-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Installation
Mike Burns edited this page Apr 14, 2023
·
17 revisions
See the factory_bot_rails repo README.
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
If you’re using rspec, add to spec/spec_helper.rb
FactoryBot.definition_file_paths = %w{./factories ./test/factories ./spec/factories} FactoryBot.find_definitions
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
FactoryBot requires ruby 1.9 compatibility mode.