fix custom ssl creation (#122)

This commit is contained in:
Saeed Vaziry
2024-03-18 17:17:45 +01:00
committed by GitHub
parent 3dc38bf56b
commit 7949165648
4 changed files with 49 additions and 7 deletions

View File

@ -41,7 +41,7 @@ public function test_see_ssls_list_with_no_ssls()
->assertSeeText(__("You don't have any SSL certificates yet!"));
}
public function test_create_ssl()
public function test_letsencrypt_ssl()
{
SSH::fake('Successfully received certificate');
@ -61,6 +61,29 @@ public function test_create_ssl()
]);
}
public function test_custom_ssl()
{
SSH::fake('Successfully received certificate');
$this->actingAs($this->user);
$this->post(route('servers.sites.ssl.store', [
'server' => $this->server,
'site' => $this->site,
]), [
'type' => SslType::CUSTOM,
'certificate' => 'certificate',
'private' => 'private',
'expires_at' => now()->addYear()->format('Y-m-d'),
])->assertSessionDoesntHaveErrors();
$this->assertDatabaseHas('ssls', [
'site_id' => $this->site->id,
'type' => SslType::CUSTOM,
'status' => SslStatus::CREATED,
]);
}
public function test_delete_ssl()
{
SSH::fake();