goldbergyoni / goldbergyoni/nodejs-testing-best-practices
How to test if a delete request actually deletes the resource
Open
- Dominant language
- JavaScript
- Stars
- 4.4k
- Forks
- 288
- PR merge metrics
- No merged PRs in 30d
Description
We have a user which has a few comments.
When we delete the user, we should delete all its comments as well.
How can we test that the **comments** get deleted?
We can't do this through an API because the user doesn't exist anymore and:
```
GET /api/users/3/comments
```
Will return `404` error code because user `3` doesn't exist and not because user has 0 comments.
Contributor guide
Assessment
This issue has not been assessed yet.