mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 14:36:17 +00:00
refactoring (#116)
- refactoring architecture - fix incomplete ssh logs - code editor for scripts in the app - remove Jobs and SSHCommands
This commit is contained in:
@ -4,11 +4,9 @@
|
||||
|
||||
use App\Enums\SslStatus;
|
||||
use App\Enums\SslType;
|
||||
use App\Jobs\Ssl\Deploy;
|
||||
use App\Jobs\Ssl\Remove;
|
||||
use App\Facades\SSH;
|
||||
use App\Models\Ssl;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\Bus;
|
||||
use Tests\TestCase;
|
||||
|
||||
class SslTest extends TestCase
|
||||
@ -45,7 +43,7 @@ public function test_see_ssls_list_with_no_ssls()
|
||||
|
||||
public function test_create_ssl()
|
||||
{
|
||||
Bus::fake();
|
||||
SSH::fake('Successfully received certificate');
|
||||
|
||||
$this->actingAs($this->user);
|
||||
|
||||
@ -59,15 +57,13 @@ public function test_create_ssl()
|
||||
$this->assertDatabaseHas('ssls', [
|
||||
'site_id' => $this->site->id,
|
||||
'type' => SslType::LETSENCRYPT,
|
||||
'status' => SslStatus::CREATING,
|
||||
'status' => SslStatus::CREATED,
|
||||
]);
|
||||
|
||||
Bus::assertDispatched(Deploy::class);
|
||||
}
|
||||
|
||||
public function test_delete_ssl()
|
||||
{
|
||||
Bus::fake();
|
||||
SSH::fake();
|
||||
|
||||
$this->actingAs($this->user);
|
||||
|
||||
@ -81,11 +77,8 @@ public function test_delete_ssl()
|
||||
'ssl' => $ssl,
|
||||
]))->assertRedirect();
|
||||
|
||||
$this->assertDatabaseHas('ssls', [
|
||||
$this->assertDatabaseMissing('ssls', [
|
||||
'id' => $ssl->id,
|
||||
'status' => SslStatus::DELETING,
|
||||
]);
|
||||
|
||||
Bus::assertDispatched(Remove::class);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user