Since we added the validation steps, we now need to ensure that requests carrying valid user payloads will get added to the database, just like before. Therefore, at the end of spec/cucumber/features/users/create/main.feature, add the following scenario outline:
Scenario Outline: Valid Profile
When the client creates a POST request to /users/
And attaches <payload> as the payload
And sends the request
Then our API should respond with a 201 HTTP status code
And the payload of the response should be a string
And the payload object should be added to the database, grouped under the "user" type
And the newly-created user should be deleted
Examples:
| payload |
| {"email":"e@ma.il","password":"password","profile":{}} |
| {"email":"e@ma.il","password":"password","profile":{"name":{}}} |
| {"email":"e@ma.il","password":"password","profile":{"name":{"first":"Daniel"}}} |
| {"email":"e@ma.il","password":"password","profile":{"bio":"bio"}} |
| {"email":"e@ma.il","password":"password","profile":{"summary":"summary"}} |
Run your tests again to make sure that they pass.