I refactored the login steps to be the following:

1) Given I am logged in with cid "bla" -> logs in an user with "bla" as its cas_user id. This will let the user pass the first filter in the AuthenticatedController, but will fail in the second one, which requires a model of an user to exist with the given CID.

2) Given I am logged in with cid "bla" as a Student/Instructor/... -> does what the previous step did plus creates a Student/Instructor/... model in the db with fake data and "bla" as cas_user. So now we can pass both filters and we can actually tests things as a registered user.