add specs for module definitions
This commit is contained in:
		
							parent
							
								
									a0f73fe0f7
								
							
						
					
					
						commit
						ff9a91705b
					
				@ -250,6 +250,14 @@ describe CanCan::Ability do
 | 
			
		||||
    @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}
 | 
			
		||||
    @ability.can?(:read, "foo" => Range).should be_true
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user