test(tunnel): clarify unauthenticated redirect assertions on tunnel routes [AUD-TST-001]
This commit is contained in:
parent
4676d3de67
commit
ad36fd4596
1 changed files with 85 additions and 85 deletions
|
|
@ -7,88 +7,8 @@ use Database\Seeders\ContentSeeder;
|
|||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\View;
|
||||
|
||||
describe('TunnelController', function () {
|
||||
it('can access get /commande/confirmation', function () {
|
||||
// GIVEN
|
||||
$this->seed(ContentSeeder::class);
|
||||
View::share('PageList', Page::getCached()
|
||||
->mapWithKeys(fn ($page) => [
|
||||
$page->slug->value() => $page,
|
||||
]));
|
||||
Cache::flush();
|
||||
|
||||
// WHEN
|
||||
$response = $this->get('/commande/confirmation');
|
||||
|
||||
// THEN
|
||||
$response->assertStatus(302);
|
||||
});
|
||||
|
||||
it('can access post /commande/confirmation', function () {
|
||||
// GIVEN
|
||||
$this->seed(ContentSeeder::class);
|
||||
View::share('PageList', Page::getCached()
|
||||
->mapWithKeys(fn ($page) => [
|
||||
$page->slug->value() => $page,
|
||||
]));
|
||||
Cache::flush();
|
||||
|
||||
// WHEN
|
||||
$response = $this->post('/commande/confirmation', []);
|
||||
|
||||
// THEN
|
||||
$response->assertStatus(302);
|
||||
});
|
||||
|
||||
it('can access get /commande/confirmation/1', function () {
|
||||
// GIVEN
|
||||
$this->seed(ContentSeeder::class);
|
||||
View::share('PageList', Page::getCached()
|
||||
->mapWithKeys(fn ($page) => [
|
||||
$page->slug->value() => $page,
|
||||
]));
|
||||
Cache::flush();
|
||||
|
||||
// WHEN
|
||||
$response = $this->get('/commande/confirmation/1');
|
||||
|
||||
// THEN
|
||||
$response->assertStatus(302);
|
||||
});
|
||||
|
||||
it('can access get /commande/creneaux', function () {
|
||||
// GIVEN
|
||||
$this->seed(ContentSeeder::class);
|
||||
View::share('PageList', Page::getCached()
|
||||
->mapWithKeys(fn ($page) => [
|
||||
$page->slug->value() => $page,
|
||||
]));
|
||||
Cache::flush();
|
||||
|
||||
// WHEN
|
||||
$response = $this->get('/commande/creneaux');
|
||||
|
||||
// THEN
|
||||
$response->assertStatus(302);
|
||||
});
|
||||
|
||||
it('can access post /commande/creneaux', function () {
|
||||
// GIVEN
|
||||
$this->seed(ContentSeeder::class);
|
||||
View::share('PageList', Page::getCached()
|
||||
->mapWithKeys(fn ($page) => [
|
||||
$page->slug->value() => $page,
|
||||
]));
|
||||
Cache::flush();
|
||||
|
||||
// WHEN
|
||||
$response = $this->post('/commande/creneaux', []);
|
||||
|
||||
// THEN
|
||||
$response->assertStatus(302);
|
||||
});
|
||||
|
||||
it('can access get /commande/panier', function () {
|
||||
describe('TunnelController', function (): void {
|
||||
it('redirects unauthenticated guest accessing basket summary to login', function (): void {
|
||||
// GIVEN
|
||||
$this->seed(ContentSeeder::class);
|
||||
View::share('PageList', Page::getCached()
|
||||
|
|
@ -101,10 +21,10 @@ describe('TunnelController', function () {
|
|||
$response = $this->get('/commande/panier');
|
||||
|
||||
// THEN
|
||||
$response->assertStatus(302);
|
||||
$response->assertRedirectToRoute('fo.auth.connexion');
|
||||
});
|
||||
|
||||
it('can access post /commande/panier', function () {
|
||||
it('redirects unauthenticated guest submitting basket summary to login', function (): void {
|
||||
// GIVEN
|
||||
$this->seed(ContentSeeder::class);
|
||||
View::share('PageList', Page::getCached()
|
||||
|
|
@ -117,6 +37,86 @@ describe('TunnelController', function () {
|
|||
$response = $this->post('/commande/panier', []);
|
||||
|
||||
// THEN
|
||||
$response->assertStatus(302);
|
||||
$response->assertRedirectToRoute('fo.auth.connexion');
|
||||
});
|
||||
|
||||
it('redirects unauthenticated guest accessing pick time slot to login', function (): void {
|
||||
// GIVEN
|
||||
$this->seed(ContentSeeder::class);
|
||||
View::share('PageList', Page::getCached()
|
||||
->mapWithKeys(fn ($page) => [
|
||||
$page->slug->value() => $page,
|
||||
]));
|
||||
Cache::flush();
|
||||
|
||||
// WHEN
|
||||
$response = $this->get('/commande/creneaux');
|
||||
|
||||
// THEN
|
||||
$response->assertRedirectToRoute('fo.auth.connexion');
|
||||
});
|
||||
|
||||
it('redirects unauthenticated guest submitting pick time slot to login', function (): void {
|
||||
// GIVEN
|
||||
$this->seed(ContentSeeder::class);
|
||||
View::share('PageList', Page::getCached()
|
||||
->mapWithKeys(fn ($page) => [
|
||||
$page->slug->value() => $page,
|
||||
]));
|
||||
Cache::flush();
|
||||
|
||||
// WHEN
|
||||
$response = $this->post('/commande/creneaux', []);
|
||||
|
||||
// THEN
|
||||
$response->assertRedirectToRoute('fo.auth.connexion');
|
||||
});
|
||||
|
||||
it('redirects unauthenticated guest accessing confirmation to login', function (): void {
|
||||
// GIVEN
|
||||
$this->seed(ContentSeeder::class);
|
||||
View::share('PageList', Page::getCached()
|
||||
->mapWithKeys(fn ($page) => [
|
||||
$page->slug->value() => $page,
|
||||
]));
|
||||
Cache::flush();
|
||||
|
||||
// WHEN
|
||||
$response = $this->get('/commande/confirmation');
|
||||
|
||||
// THEN
|
||||
$response->assertRedirectToRoute('fo.auth.connexion');
|
||||
});
|
||||
|
||||
it('redirects unauthenticated guest submitting confirmation to login', function (): void {
|
||||
// GIVEN
|
||||
$this->seed(ContentSeeder::class);
|
||||
View::share('PageList', Page::getCached()
|
||||
->mapWithKeys(fn ($page) => [
|
||||
$page->slug->value() => $page,
|
||||
]));
|
||||
Cache::flush();
|
||||
|
||||
// WHEN
|
||||
$response = $this->post('/commande/confirmation', []);
|
||||
|
||||
// THEN
|
||||
$response->assertRedirectToRoute('fo.auth.connexion');
|
||||
});
|
||||
|
||||
it('redirects unauthenticated guest accessing confirmed order to login', function (): void {
|
||||
// GIVEN
|
||||
$this->seed(ContentSeeder::class);
|
||||
View::share('PageList', Page::getCached()
|
||||
->mapWithKeys(fn ($page) => [
|
||||
$page->slug->value() => $page,
|
||||
]));
|
||||
Cache::flush();
|
||||
|
||||
// WHEN
|
||||
$response = $this->get('/commande/confirmation/1');
|
||||
|
||||
// THEN
|
||||
$response->assertRedirectToRoute('fo.auth.connexion');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue