I'm working on writing tests for a rails application using cucumber and capybara. I have a scenario for a user editing a post, and making it invalid.
The scenario looks like this:
Scenario: I edit a post and make the data invalid.
Given I have 1 post
And I view my 1st post
Then I click "Edit"
And I fill in the edit post form with bad data
When I click the "Update post" button
Then I should see "Title is too short (minimum is 3 characters)"
And I should see "Body is too short (minimum is 30 characters)"
Should I leave the scenario as-is, or create a scenario for entering the title incorrectly, and another scenario for entering the body incorrectly, like this:
Scenario: I edit a post and make the title too short.
Given I have 1 post
And I view my 1st post
Then I click "Edit"
And I fill in the edit post form with a title that is too short
When I click the "Update post" button
Then I should see "Title is too short (minimum is 3 characters)"
Scenario: I edit a post and make the body too short.
Given I have 1 post
And I view my 1st post
Then I click "Edit"
And I fill in the edit post form with a body that is too short
When I click the "Update post" button
Then I should see "Body is too short (minimum is 30 characters)"
If the post has several more fields, should I still create a scenario for each one, or would it be more DRY to use one scenario?