Update API return and fix failing test

This commit is contained in:
Matthew Ross 2017-02-02 05:58:02 -05:00
parent c0c06b7553
commit 5aecff9e56
2 changed files with 3 additions and 4 deletions

View File

@ -107,10 +107,9 @@ class AutoActions extends BaseController {
json_encode($before), '', 'action', $id);
$autoActions = R::findAll('autoaction');
$data = [];
foreach ($autoActions as $action) {
$data = [];
if (Auth::HasBoardAccess($request, $action->board_id)) {
$data[] = $action;
}

View File

@ -33,7 +33,7 @@ class AutoActionsTest extends PHPUnit_Framework_TestCase {
$actual = $this->actions->getAllActions($request,
new ResponseMock(), null);
$this->assertEquals(2, count($actual->data));
$this->assertEquals(1, count($actual->data[1]));
$this->assertEquals('success', $actual->status);
DataMock::CreateStandardUser();
@ -42,7 +42,7 @@ class AutoActionsTest extends PHPUnit_Framework_TestCase {
$actual = $this->actions->getAllActions($request,
new ResponseMock(), null);
$this->assertEquals(1, count($actual->data));
$this->assertEquals(0, count($actual->data[1]));
$this->assertEquals('success', $actual->status);
}