Create new description endpoint (#1136)

Co-authored-by: RMartinOscar <40749467+RMartinOscar@users.noreply.github.com>
This commit is contained in:
pelican-vehikl
2025-06-06 23:06:28 -04:00
committed by GitHub
parent 34865d4288
commit 65deffc6e6
7 changed files with 59 additions and 18 deletions

View File

@@ -21,11 +21,9 @@ class SettingsControllerTest extends ClientApiIntegrationTestCase
/** @var \App\Models\Server $server */
[$user, $server] = $this->generateTestAccount($permissions);
$originalName = $server->name;
$originalDescription = $server->description;
$response = $this->actingAs($user)->postJson("/api/client/servers/$server->uuid/settings/rename", [
'name' => '',
'description' => '',
]);
$response->assertStatus(Response::HTTP_UNPROCESSABLE_ENTITY);
@@ -33,18 +31,15 @@ class SettingsControllerTest extends ClientApiIntegrationTestCase
$server = $server->refresh();
$this->assertSame($originalName, $server->name);
$this->assertSame($originalDescription, $server->description);
$this->actingAs($user)
->postJson("/api/client/servers/$server->uuid/settings/rename", [
'name' => 'Test Server Name',
'description' => 'This is a test server.',
])
->assertStatus(Response::HTTP_NO_CONTENT);
$server = $server->refresh();
$this->assertSame('Test Server Name', $server->name);
$this->assertSame('This is a test server.', $server->description);
}
/**