Stories 0.2-0.5: rename folders→declarations (backend+frontend), configure Redis for cache/queue/sessions, add foundation database migrations (permissions, archived_at), replace DeclarationStatus enum with architecture lifecycle values, create DeclarationObserver for status transition validation and auto-archive, fix controller status transitions to respect observer rules. 93 tests pass (240 assertions). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
30 lines
759 B
PHP
30 lines
759 B
PHP
<?php
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Auth\Notifications\VerifyEmail;
|
|
use Illuminate\Support\Facades\Notification;
|
|
|
|
test('sends verification notification', function () {
|
|
Notification::fake();
|
|
|
|
$user = User::factory()->unverified()->create();
|
|
|
|
$this->actingAs($user)
|
|
->post(route('verification.send'))
|
|
->assertRedirect(route('home'));
|
|
|
|
Notification::assertSentTo($user, VerifyEmail::class);
|
|
});
|
|
|
|
test('does not send verification notification if email is verified', function () {
|
|
Notification::fake();
|
|
|
|
$user = User::factory()->create();
|
|
|
|
$this->actingAs($user)
|
|
->post(route('verification.send'))
|
|
->assertRedirect(route('dashboard', absolute: false));
|
|
|
|
Notification::assertNothingSent();
|
|
});
|