Skip to content
Browse files

add specs for module definitions

  • Loading branch information...
1 parent a0f73fe commit ff9a91705bac92621c09f605563c544d7ddddae2 @funny-falcon funny-falcon committed with Sep 13, 2010
Showing with 8 additions and 0 deletions.
  1. +8 −0 spec/cancan/ability_spec.rb
View
8 spec/cancan/ability_spec.rb
@@ -249,6 +249,14 @@
@ability.can?(:read, 1..5).should be_false
@ability.can?(:read, Range).should be_true
end
+
+ it "should allow to check ability for Module" do
+ module B; end
+ class A; include B; end
+ @ability.can :read, B
+ @ability.can?(:read, A).should be_true
+ @ability.can?(:read, A.new).should be_true
+ end
it "passing a hash of subjects should check permissions through association" do
@ability.can :read, Range, :string => {:length => 3}

0 comments on commit ff9a917

Please sign in to comment.
Something went wrong with that request. Please try again.