I want to write test for edit post
I write something like:
Given I'm on "/post/1/edit" page
but in this time I haven’t record with ID = 1, even if I created it in previous test
How to solve it?
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.
Because it’s a test database, you won’t know what the id is exactly. I think you’re better off to follow the edit link from the index after the post is created.