stage 1 of oauth removal, switch to sanctum pat tokens
This commit is contained in:
42
tests/Feature/Auth/TenantAdminEntryTest.php
Normal file
42
tests/Feature/Auth/TenantAdminEntryTest.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\Auth;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class TenantAdminEntryTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
public function test_guest_is_redirected_to_admin_start(): void
|
||||
{
|
||||
$response = $this->get('/event-admin/dashboard');
|
||||
|
||||
$response->assertRedirect('/event-admin/start');
|
||||
}
|
||||
|
||||
public function test_tenant_admin_can_access_admin_shell(): void
|
||||
{
|
||||
$user = User::factory()->create([
|
||||
'role' => 'tenant_admin',
|
||||
]);
|
||||
|
||||
$response = $this->actingAs($user)->get('/event-admin/dashboard');
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertViewIs('admin');
|
||||
}
|
||||
|
||||
public function test_regular_user_is_redirected_to_packages(): void
|
||||
{
|
||||
$user = User::factory()->create([
|
||||
'role' => 'user',
|
||||
]);
|
||||
|
||||
$response = $this->actingAs($user)->get('/event-admin/dashboard');
|
||||
|
||||
$response->assertRedirect('/packages');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user