support custom objects (usually symbols) in can definition - closes #8

This commit is contained in:
Ryan Bates
2009-11-25 09:55:50 -08:00
parent 5bd1a85410
commit e60365505c
3 changed files with 16 additions and 1 deletions

View File

@@ -99,4 +99,11 @@ describe CanCan::Ability do
@ability.can?(:update, []).should be_true
@ability.can?(:update, 123).should be_false
end
it "should support custom objects in the can definition" do
@ability.can :read, :stats
@ability.can?(:read, :stats).should be_true
@ability.can?(:update, :stats).should be_false
@ability.can?(:read, :nonstats).should be_false
end
end