RailsApps / rails_apps_composer

A gem with recipes to create Rails application templates for Rails starter apps.
http://railsapps.github.io/rails_apps_composer/
1.42k stars 306 forks source link

FactoryGirl::Syntax::Methods isn't included when configuring FactoryGirl #283

Closed akshatpradhan closed 10 years ago

akshatpradhan commented 10 years ago

In order for people to use FactoryGirl more DRYly, the line config.include FactoryGirl::Syntax::Methods should be included by default in spec/spec_helper.rb

This enables me to do things like

create(:todo, description: 'buy some milk')

instead of having to do

FactoryGirl.create(:todo, description: 'buy some milk')

If you do not include FactoryGirl::Syntax::Methods in your test suite, then all factory_girl methods will need to be prefaced with FactoryGirl. Having to repeat FactoryGirl over and over again is not DRY.

DanielKehoe commented 10 years ago

This is now included in the file _spec/support/factorygirl.rb (same effect as _spec/spechelper.rb).

Please open a new issue if you see any problems. Thanks for your support.