[API. Tasks] Admin can edit the task with invalid name
TetianaFilatova opened this issue · comments
Environment: Windows 10 Pro
Postman for Windows Version 10.12.10
Reproducible: always
Preconditions
- Run Postman
- Create new request > Choose 'PUT' in 'Method' drop-down
- Enter request URL: https://speak-ukrainian.org.ua/dev/api/challenge/task/x (You need to replace "x" in URL with the existing task ID (you can check the site or DB))
- Navigate to 'Authorization' tab, choose 'Bearer Token' in 'Type' drop-down
- Set 'accessToken' of user with admin rights (e. g. 'email': "admin@gmail.com", 'password': "admin") in 'Token' field
TD1 "{
"challengeId" : "62",
"headerText" : "header text must contain min fourty letters",
"name": " ",
"description": " ",
"picture": "/upload/test/test.png",
"startDate": "2023-11-03"
}"
TD2 "{
"challengeId" : "777",
"headerText" : "header text must contain min fourty letters",
"name": " namenamename1213#$%namenamename1213#$%namenamename1213#$%namenamename1213#$%namenamename1213#$%namenamename1213#$%namenamename1213#$%namenamename1213#$%namenamename1213#$%namenamename1213#$%namenamename1213#$%namenamename1213#$%namenamename1213#$%",
"description": " descriptiondescriptiondescriptiondescriptiondescription12345$%%^$# ",
"picture": "/upload/test/test.png",
"startDate": "2023-12-03"
}"
Steps to reproduce
- Choose 'Body' > 'raw' > 'JSON'
- Create new request with TD1
- Click 'Send' button
- Pay attention to appear error message
- Create new request with TD2
- Click 'Send' button
Actual result
Task is eddited with invalid data in the "name" field
Expected result
Error message "name must contain a minimum of 5 and a maximum of 50 letters" is appeared
User story and test case links
E.g.: "User story #1335
Test case
Test case
)"