This unit test would be more robust if we not only checked the HTTP response, but we also checked the database to ensure state has been modified as we're intending.
Clearing the database
The database contents will obviously persist across tests, which makes it unpredictable. For this reason, we should make sure the database is cleared before every test runs to ensure that pre-existing data doesn't interfere with our tests.
Click to load comments...