public function testShouldLoadCollectionResourceWhenDefiningAuthorityRulesThroughClosure()
{
$project = $this->mock('Project');
$project->shouldReceive('get')->never()->andReturn("found_projects");
$this->params['action'] = "index";
$this->authority->allow('read', 'Project', function ($self, $p) {
return false;
});
$resource = new Efficiently\AuthorityController\ControllerResource($this->controller);
$resource->loadResource();
$this->assertNull($this->getProperty($this->controller, 'project'));
$this->assertFalse(property_exists($this->controller, 'projects'));
}