Migrate Tests to be HTTP Based #296
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR migrates a huge number of our tests to be HTTP based only, instead of manually calling the specific functions (e.g.
endpoint.logic()) of each endpoint.Doing this means we are moving tests to the only contract the backend has, it's actual API.
The reason we need to do this is that we can begin modifying the way we interact with endpoints without having to rewrite tests each time, and means we more reliably are testing exactly the output users get.
Doing this en-mass is a precursor to being able to do something like #293 more widely.
Since this is a test only change, as long as everything passes we should be golden, the methodology we use is already in use in this codebase, we are just using it more than before.
EDIT:::
You'll also noticed I added a new DB method, for deleting a user. This is currently inaccessible via the API, but allows us to preform proper cleanup during HTTP based tests, and eventually we really should make it accessible via the API.