Rails project uses factory_girl gem instead of factory_girl_rails gem - is that a problem?

147 views
Skip to first unread message

Tsvetelina Borisova

unread,
Feb 15, 2013, 6:52:34 AM2/15/13
to factor...@googlegroups.com
I couldn't find any articles about that topic. Also can you help me with articles about the difference between using Factory to create/build оbjects and FactoryGirl when creating/building objects

Josh Clayton

unread,
Feb 15, 2013, 8:57:26 AM2/15/13
to factor...@googlegroups.com
factory_girl_rails is for Rails 3.x+ projects - if you're on a Rails 2 project, using factory_girl by itself is perfectly fine.

Tsvetelina Borisova

unread,
Feb 15, 2013, 9:23:22 AM2/15/13
to factor...@googlegroups.com
Thank you for answering. The project is with rails 3.0.9 is there a problem with using factory_girl not factory_giril_rails. Why should we use factory_girl_rails?

Josh Clayton

unread,
Feb 15, 2013, 9:30:38 AM2/15/13
to factor...@googlegroups.com
With factory_girl_rails, your factory files will be loaded automatically, whereas with factory_girl you'll have to load them by hand. Additionally, factory_girl_rails provides generators for your ORM to build factories when you use Rails' generate model commands.
Reply all
Reply to author
Forward
0 new messages