Testing your rules
Testing your rules is straightforward.
Simply import your Guard instance from the ability file and use Guard.can to test the rules against different conditions.
Testing your business logic#
Testing your endpoints#
Guard.authorize will raise an AuthorizationError exception if the user is not authorized, this is what you have to look for when testing your endpoints.