Feature/add remote server logs (#159)

This commit is contained in:
Borja Jiménez
2024-04-14 14:34:47 +02:00
committed by GitHub
parent 75aed62d75
commit 4517ca7d2a
25 changed files with 385 additions and 26 deletions

View File

@ -23,4 +23,37 @@ public function test_see_logs()
->assertSuccessful()
->assertSeeText($log->type);
}
public function test_see_logs_remote()
{
$this->actingAs($this->user);
/** @var ServerLog $log */
$log = ServerLog::factory()->create([
'server_id' => $this->server->id,
'is_remote' => true,
'type' => 'remote',
'name' => 'see-remote-log',
]);
$this->get(route('servers.logs.remote', $this->server))
->assertSuccessful()
->assertSeeText('see-remote-log');
}
public function test_create_remote_log()
{
$this->actingAs($this->user);
$this->post(route('servers.logs.remote.store', [
'server' => $this->server->id,
]), [
'path' => 'test-path',
])->assertOk();
$this->assertDatabaseHas('server_logs', [
'is_remote' => true,
'name' => 'test-path',
]);
}
}