What is the preferred way to have testing data - fixtures, or
something like factory_girl (thoughtbot, inc. · GitHub
factory_girl)?
I definitely need something that can handle relationships between
things - for example, an article belongs to a section / a section has
many articles.
Also, how do people generally load seed data? I know about rake
db:seed…but do people generally load something (like fixtures) in
the seeds.rb file instead of typing out all this stuff in there?
There must be a clean way to handle all of this!
I think I’m going to try factory_girl if no one has major objections…
What is the preferred way to have testing data - fixtures, or
something like factory_girl (thoughtbot, inc. · GitHub
factory_girl)?
Factories. Never use fixtures, ever, for anything.
I definitely need something that can handle relationships between
things - for example, an article belongs to a section / a section has
many articles.
If you had checked the documentation for Factory Girl and Machinist, you
would know that they can do this.
Also, how do people generally load seed data? I know about rake
db:seed…but do people generally load something (like fixtures) in
the seeds.rb file instead of typing out all this stuff in there?
There must be a clean way to handle all of this!
There is. The seeds.rb file or the seed_fu plugin.
I think I’m going to try factory_girl if no one has major objections…