Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System allows save review with text that = whitespaces. #310

Open
TetianaPerinha opened this issue Jun 6, 2024 · 1 comment · Fixed by #311
Open

System allows save review with text that = whitespaces. #310

TetianaPerinha opened this issue Jun 6, 2024 · 1 comment · Fixed by #311
Labels
bug Something isn't working medium priority Medium priority issue

Comments

@TetianaPerinha
Copy link
Collaborator

TetianaPerinha commented Jun 6, 2024

Describe the bug
When sending a POST review request with text =whitespaces, the system allows it to save.

Precondition:
User is registered, the Bearer token is obtained, and the user has not posted a review on a product.

To Reproduce
Send the POST request as below, and use a valid Bearer token.

curl --location 'https://iced-latte.uk/backend/api/v1/products/ba5f15c4-1f72-4b97-b9cf-4437e5c6c2fa/reviews'
--header 'Content-Type: application/json'
--header 'Authorization: {token}'
--data '{
"text": " ",
"rating": "5"

}'
Expected behavior
The system should reject request with 400 HTTP Status code and return the appropriate error message = "Invalid data".

Actual result
System accept the request, HTTP Status code = 200 and review posted with text = " "
alows save review with whitespace

@TetianaPerinha TetianaPerinha added bug Something isn't working medium priority Medium priority issue labels Jun 6, 2024
RaffhanKhan added a commit to RaffhanKhan/Iced-Latte that referenced this issue Jun 6, 2024
@RaffhanKhan
Copy link
Contributor

@TetianaPerinha / @Sunagatov I have fixed the bug please validate and approve.

Sunagatov added a commit that referenced this issue Jun 15, 2024
Issue #310  - handled wide space with EmptyProductReviewException
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working medium priority Medium priority issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants