I have a dropdown box that is populated using data from the database (via Angular).
I am trying to test it with Capybara and Poltergeist using:
select('San Francisco', from: "user_region")
As the test database starts with a clean DB, the San Francisco option in the database cannot be loaded. How should I populate the dropdown box if I have no DB?
One idea is to run the db:seed from seed.rb but I'd rather rely on less assumptions when I run my tests. Is there a way to use something like Factory Girl?
Thanks,
For Example, when you have the following capybara test case, use the background block to setup the data you need for your testing
Here is the link for factory_girl if you don't know about it already. It comes very handy in setting up data for all kinds of tests.