views:

443

answers:

1

Hello!

I am trying to use FactoryGirl instead of default fixtures in edge Rails 3. I used

http://github.com/pjb3/rails3-generators

and tried to do the replacement as adviced in

http://paulbarry.com/articles/2010/01/13/customizing-generators-in-rails-3

this way (config/application.rb)

config.generators do |g|
  g.orm             :active_record
  g.template_engine :erb
  g.test_framework  :test_unit, :fixture => true
  g.fixture_replacement "factory_girl", :dir => "test/factories"
end

looks good, doesn't it? But it does not work ... any ideas?

+4  A: 

It seems that the proper way to do it (at least for now :)) is slightly different:

config.generators do |g|
  g.orm             :active_record
  g.template_engine :erb
  g.test_framework  :test_unit, :fixture_replacement => :factory_girl
end
szimek
Thanks! I tried to find it in code but gave up too early.
Jakub
I had the exact same problem. Googled for "g.fixture_replacement" and found this in second place after the blog from paulberry
jigfox
This works for me, but any idea how to change the factories directory for now?
pakeha