43 lines
1.1 KiB
PHP
43 lines
1.1 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('RegisterController', function () {
|
||
|
|
it('can access get /auth/inscription', function () {
|
||
|
|
// GIVEN
|
||
|
|
$this->seed(ContentSeeder::class);
|
||
|
|
View::share('PageList', Page::getCached()
|
||
|
|
->mapWithKeys(fn ($page) => [
|
||
|
|
$page->slug->value() => $page,
|
||
|
|
]));
|
||
|
|
Cache::flush();
|
||
|
|
|
||
|
|
// WHEN
|
||
|
|
$response = $this->get('/auth/inscription');
|
||
|
|
|
||
|
|
// THEN
|
||
|
|
$response->assertStatus(200);
|
||
|
|
});
|
||
|
|
|
||
|
|
it('can access post /auth/inscription', function () {
|
||
|
|
// GIVEN
|
||
|
|
$this->seed(ContentSeeder::class);
|
||
|
|
View::share('PageList', Page::getCached()
|
||
|
|
->mapWithKeys(fn ($page) => [
|
||
|
|
$page->slug->value() => $page,
|
||
|
|
]));
|
||
|
|
Cache::flush();
|
||
|
|
|
||
|
|
// WHEN
|
||
|
|
$response = $this->post('/auth/inscription', []);
|
||
|
|
|
||
|
|
// THEN
|
||
|
|
$response->assertStatus(302);
|
||
|
|
});
|
||
|
|
});
|