74 lines
1.9 KiB
PHP
74 lines
1.9 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Models\Page;
|
|
use Database\Seeders\ContentSeeder;
|
|
use Illuminate\Support\Facades\Cache;
|
|
use Illuminate\Support\Facades\View;
|
|
|
|
describe('PageController', function () {
|
|
it('can access get /cgv', function () {
|
|
// GIVEN
|
|
$this->seed(ContentSeeder::class);
|
|
View::share('PageList', Page::getCached()
|
|
->mapWithKeys(fn ($page) => [
|
|
$page->slug->value() => $page,
|
|
]));
|
|
Cache::flush();
|
|
|
|
// WHEN
|
|
$response = $this->get('/cgv');
|
|
|
|
// THEN
|
|
$response->assertStatus(200);
|
|
});
|
|
|
|
it('can access get /charte-de-confidentialite', function () {
|
|
// GIVEN
|
|
$this->seed(ContentSeeder::class);
|
|
View::share('PageList', Page::getCached()
|
|
->mapWithKeys(fn ($page) => [
|
|
$page->slug->value() => $page,
|
|
]));
|
|
Cache::flush();
|
|
|
|
// WHEN
|
|
$response = $this->get('/charte-de-confidentialite');
|
|
|
|
// THEN
|
|
$response->assertStatus(200);
|
|
});
|
|
|
|
it('can access get /faq', function () {
|
|
// GIVEN
|
|
$this->seed(ContentSeeder::class);
|
|
View::share('PageList', Page::getCached()
|
|
->mapWithKeys(fn ($page) => [
|
|
$page->slug->value() => $page,
|
|
]));
|
|
Cache::flush();
|
|
|
|
// WHEN
|
|
$response = $this->get('/faq');
|
|
|
|
// THEN
|
|
$response->assertStatus(200);
|
|
});
|
|
|
|
it('can access get /mentions-legales', function () {
|
|
// GIVEN
|
|
$this->seed(ContentSeeder::class);
|
|
View::share('PageList', Page::getCached()
|
|
->mapWithKeys(fn ($page) => [
|
|
$page->slug->value() => $page,
|
|
]));
|
|
Cache::flush();
|
|
|
|
// WHEN
|
|
$response = $this->get('/mentions-legales');
|
|
|
|
// THEN
|
|
$response->assertStatus(200);
|
|
});
|
|
});
|