Unit Tests

We will learn how to add tests to verify the Product model.

Data for testing

As discussed earlier, we need a user with one of the products to test the Product model and its interaction with the User model. Take a look at the fixture.yml of the Product model below.

Get hands-on with 1200+ tech skills courses.