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, isn't it? But it does not work ... any ideas?
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
For Rails 3.1.rc1 you need "gem 'rails3-generators'" in your Gemfile for the factory_girl fixture replacement to work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With