complete story 9.7 with qa tests

This commit is contained in:
Naser Mansour
2026-01-03 02:17:47 +02:00
parent 35591d76b4
commit 090326b682
3 changed files with 391 additions and 32 deletions
+17
View File
@@ -1,7 +1,14 @@
<?php
use App\Models\Page;
use App\Models\User;
beforeEach(function () {
// Seed the legal pages required for terms/privacy tests
Page::factory()->terms()->create();
Page::factory()->privacy()->create();
});
describe('Public Pages', function () {
test('home page is accessible', function () {
$this->get(route('home'))
@@ -20,12 +27,22 @@ describe('Public Pages', function () {
});
test('terms page is accessible', function () {
// Legacy route redirects to /page/terms
$this->get(route('terms'))
->assertRedirect('/page/terms');
// Actual page responds correctly
$this->get('/page/terms')
->assertOk();
});
test('privacy page is accessible', function () {
// Legacy route redirects to /page/privacy
$this->get(route('privacy'))
->assertRedirect('/page/privacy');
// Actual page responds correctly
$this->get('/page/privacy')
->assertOk();
});
});