Add test coverage for allocation assignment endpoint
This commit is contained in:
parent
b2be067f38
commit
d493685518
6 changed files with 204 additions and 79 deletions
|
@ -122,6 +122,12 @@ class NetworkAllocationController extends ClientApiController
|
|||
*/
|
||||
public function store(NewAllocationRequest $request, Server $server): array
|
||||
{
|
||||
if ($server->allocations()->count() >= $server->allocation_limit) {
|
||||
throw new DisplayException(
|
||||
'Cannot assign additional allocations to this server: limit has been reached.'
|
||||
);
|
||||
}
|
||||
|
||||
$allocation = $this->assignableAllocationService->handle($server);
|
||||
|
||||
return $this->fractal->item($allocation)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue