You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#70 added a bunch of tests for the routes, but it only tests the happy path (what's supposed to happen). We need "negative" unit tests that test that the app fails gracefully and as expected based on bogus input. In those situations where HTML is returned instead of JSON, or the api returns a 500 instead of a 400 series error, the route should be modified such that it will return the expected/required input. When someone puts in a PR for a negative unit test that requires a change of behavior, we can discuss in that PR what the exact behavior we want ought to be.
Acceptance criteria:
Each route should have a few negative unit tests with bogus input. The test should verify that JSON is returned (preferably with a helpful error message). The API should never return HTML, so unit tests should verify a valid JSON response. No error should leak any information about our database. The HTTP status code returned should be as specific as possible (e.g., a 422 is favored over a 400 when invalid input is returned).
Ok @thinkingserious thanks! Most of the newer routes have negative unit tests. I'm mostly concerned with the Create and Update Resources endpoints because those are the ones that actually make changes to the data. We want to make sure that with bogus input, or super long input, or potentially problematic input like strange characters and emojis, the app is resilient enough to handle it
Activity
thinkingserious commentedon Oct 23, 2019
I can take this one, thanks!
aaron-junot commentedon Oct 23, 2019
Ok @thinkingserious thanks! Most of the newer routes have negative unit tests. I'm mostly concerned with the Create and Update Resources endpoints because those are the ones that actually make changes to the data. We want to make sure that with bogus input, or super long input, or potentially problematic input like strange characters and emojis, the app is resilient enough to handle it