Quickly test an ability
suggest changeTo check an ability in the console, or anywhere else the Rails environment is loaded, pass a user:
test_ability = Ability.new(User.first)
test_ability.can?(:show, Post) #=> true
other_ability = Ability.new(RestrictedUser.first)
other_ability.cannot?(:show, Post) #=> true
More information: https://github.com/CanCanCommunity/cancancan/wiki/Testing-Abilities
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents