Closed tenzan closed 9 years ago
Hi, it's so when you've set FactoryGirl to replace fixtures (in config/application.rb), you can run it from the command line in your default development environment. If you'd prefer to create those files manually (and not include g.fixture_replacement ...
in config/application.rb), you might be able to only include it in :test
, but I'm not certain. If you try it, let me know what you find out!
Thanks for quick reply, Aaron!
I brought up this question because I'm also reading Rails 4 in Action these days.
In that book, they placed this gem in the group:test
, this is why I wondered.
What's the general practice? I'm just starting reading your book, will we run factory_girls from the command line at some point?
I haven't seen the Rails 4 version of that book ... do they have g.fixture_replacement :factory_girl
set in config/application.rb? That's how I've always done it ... not sure if there's a set general practice for this.
The book is http://www.manning.com/bigg2/ Repo https://github.com/rubysherpas/r4ia_examples/tree/master/ticketee
Nothing mentioned about factory_girl
in their config/application.rb
.
Ryan may be creating factories by hand instead of using a Rails generator to create them. Both ways are perfectly fine. If you do want to have Rails generate starter factory files for you, though, you'll have to include factory_girl_rails in the development group of your Gemfile.
Thanks, I understood now. :)
Hello!
gem "factory_girl_rails"
placed withingroup:development,:test
.Why it's not in the
group:test
?Thanks.