Update API return and fix failing test
This commit is contained in:
parent
c0c06b7553
commit
5aecff9e56
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user