Wrapping Up
With these final tests, we’re finally done. We’ve accomplished a lot.
We started by writing some unit tests. The goal of these tests is to check a single layer of our application in isolation. We tested our basic contexts, the user and multimedia contexts. Since both of these contexts provided persistence services, we made sure to exercise the database. The Ecto.Sandbox preserved isolation and allowed concurrent testing and the describe keyword allowed us to apply setup code to multiple tests at once, saving duplication. We paid special attention to change sets which surface errors and change tracking through the API.
Next we worked with integration tests. The goal of integration tests is to test the layers of our application working ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access