Introduction

Get familiar with some prerequisites for this chapter.

Testing Ecto queries is fairly straightforward, especially if we’re coming from testing database code in other languages. Some basic rules will help us make sure that our coverage is effective.

What will we cover?

In this chapter, we’ll explore some additional tooling that can help make long-term ownership of our test suite easier, and then we’ll write tests for Ecto queries. We’ll build on concepts from the previous chapter, Testing Ecto Schemas.

Prerequisites

For this chapter, we’re going to work with a schema called testing_ecto/lib/schemas/user.ex:

Get hands-on with 1400+ tech skills courses.