Validating a digest

Next, we need to specify a new scenario outline to assert that POST /users requests with an invalid digest payload property should receive a 400 Bad Request response. Your scenario outline may look like this:

Scenario Outline: Request Payload with invalid digest format  When the client creates a POST request to /users  And attaches a Create User payload where the digest field is exactly <digest>  And sends the request  Then our API should respond with a 400 HTTP status code  And the payload of the response should be a JSON object  And contains a message property which says "The '.digest' field should be a valid bcrypt digest"  Examples:  | digest                                                       |  | jwnY3Iq1bpT5RTsAXKOLnr3ee423zWFU23efwXF27bVKJ4VrDmWA0hZi6YI0 | | $2y$10$a7iPlM2ORVOPr0QNvDf.a.0QKEWwSGRKBaKSqv,40KFGcBuveazjW ...

Get Building Enterprise JavaScript Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.