Add extensive controller and model tests
This commit is contained in:
13
tests/Feature/SystemStatusControllerTest.php
Normal file
13
tests/Feature/SystemStatusControllerTest.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
use App\Models\User;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
|
||||
it('forbids system status for non-admins', function (): void {
|
||||
$user = User::factory()->create();
|
||||
|
||||
Sanctum::actingAs($user);
|
||||
$response = $this->getJson('/api/system/status');
|
||||
|
||||
$response->assertStatus(403);
|
||||
});
|
||||
Reference in New Issue
Block a user