Created
March 27, 2014 13:19
-
-
Save drgomesp/9807406 to your computer and use it in GitHub Desktop.
Improving readability of a Behat scenario with @rdohms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Given I go to "/register" | |
And I fill in the following: | |
... | |
When I press "Register" | |
Then I should be on "/register/check-email" | |
And I should see "__user.registration.check_email.message" | |
After this, i have a few Listeners that create objects around the User object, for example a Settings entry, with default values. | |
What would your option for testing this happened in Behat be? | |
And I should have an auto-generated Settings Entry # specific phrase | |
And 'Setting' entity was created with 'user_id' equals 'current user id' # generic entity search | |
And Current User has non-null response to 'getSettings' # generic test of object method | |
And [other?] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would have something like this:
Here you have more descriptive contexts that will abstract the actual cases.
This way you have more descriptive and clean scenario steps that can also be reused for many other features, and the actual testing is done under the sheets.