I have some test in cucumber:
And I select "vim" from "category_id"
This select filled form database, and test can’t be passed without manual insert it to db.
Is there some automatic tool to preset db before testing?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If I understand the phrasing of your question, you need to populate the db with test values. You can do this with the
db/seeds.rbfile, but a better way is to use factories for your tests. These will create objects in the database for your tests to use. Factory Girl is the best option for this in rails, so try using that: https://github.com/thoughtbot/factory_girl_rails