Files
RetroHub/tests/Feature/Auth/EmailNotificationTest.php

31 lines
752 B
PHP

<?php
namespace Tests\Feature\Auth;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class EmailNotificationTest extends TestCase
{
use RefreshDatabase;
public function test_verified_user_is_redirected(): void
{
$user = User::factory()->create();
$this->actingAs($user)
->post(route('verification.send'))
->assertRedirect(route('dashboard', absolute: false));
}
public function test_unverified_user_gets_notification(): void
{
$user = User::factory()->unverified()->create();
$this->actingAs($user)
->post(route('verification.send'))
->assertSessionHas('status', 'verification-link-sent');
}
}