public function testShouldAuthorizeNestedResourceThroughParentAssociationOnIndexAction()
{
$this->params = array_merge($this->params, array_merge(['action' => 'index']));
$category = $this->mock('Category');
$this->setProperty($this->controller, 'category', $category);
$this->controller->shouldReceive('authorize')->once()->with('index', ['Project' => $category])->once()->andThrow("Efficiently\\AuthorityController\\Exceptions\\AccessDenied");
$resource = new Efficiently\AuthorityController\ControllerResource($this->controller, ['through' => 'category']);
$this->setExpectedException("Efficiently\\AuthorityController\\Exceptions\\AccessDenied");
$resource->authorizeResource();
}