Skip to content

Commit

Permalink
Client BDD test for put request with both invalid uuid params and inv…
Browse files Browse the repository at this point in the history
…alid json request body types
  • Loading branch information
AnderGI committed Feb 15, 2025
1 parent a3941e6 commit 8404e10
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions tests/apps/backoffice/backend/features/register-clients.feature
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,44 @@ Feature: Register Clients
}
]
}
"""

Scenario: Invalid UUID path param + Invalid JSON request body types.
Given I send a PUT request to "/clients/nvhvgbvnmjb" with JSON request body:
"""
{
"name": true,
"email": "ajgh@gmail.com",
"phone": 2348678557584,
"company": "Acme Corp",
"position": 4656
}
"""
Then the response status code should be 400
Then the response body should be:
"""
{
"errors": [
{
"msg": "The id param must be a valid UUID",
"param": "id"
},
{
"msg": "Name must be a string",
"param": "name"
},
{
"msg": "Phone number must be a string",
"param": "phone"
},
{
"msg": "Phone number must be exactly 9 digits",
"param": "phone"
},
{
"msg": "Position must be a string",
"param": "position"
}
]
}
"""

0 comments on commit 8404e10

Please sign in to comment.