mirror of
https://github.com/pelican-dev/panel.git
synced 2026-05-04 18:00:48 +03:00
Create new description endpoint (#1136)
Co-authored-by: RMartinOscar <40749467+RMartinOscar@users.noreply.github.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user