More Roles Tests

Let's learn how to write tests for users and roles.

We'll cover the following...

Adding more roles test

In the previous lesson, we created a custom matcher, be_able_to_see, which takes in a list of projects and validates the can_view? and visible_projects in parallel, thereby asserting that the two methods stay in sync. It also validates that projects that aren’t specified are not visible. We get around the fixture data by explicitly specifying the universe of all_projects. (In Minitest we’d use a custom assertion. We can see an example in the sample code at /test/models/user_test.rb).

At this point, ...