23 lines
542 B
PHP
23 lines
542 B
PHP
<?php
|
|
|
|
use App\Models\User;
|
|
|
|
test('guests are redirected to the login page', function () {
|
|
$portalUrl = 'https://'.config('domains.domain_portal');
|
|
|
|
$response = $this->get($portalUrl.'/dashboard');
|
|
|
|
$response->assertRedirect('/login');
|
|
});
|
|
|
|
test('authenticated users can visit the dashboard', function () {
|
|
$portalUrl = 'https://'.config('domains.domain_portal');
|
|
|
|
$user = User::factory()->create();
|
|
|
|
$this->actingAs($user);
|
|
|
|
$response = $this->get($portalUrl.'/dashboard');
|
|
|
|
$response->assertStatus(200);
|
|
});
|