mirror of
https://github.com/usetrmnl/larapaper.git
synced 2026-08-13 14:28:54 -07:00
Upstream: laravel/livewire-starter-kit@0ca77fa Adds skipUnlessFortifyHas on TestCase and Fortify-aware skips/assertions in auth tests. Co-authored-by: Cursor <cursoragent@cursor.com>
30 lines
747 B
PHP
30 lines
747 B
PHP
<?php
|
|
|
|
use Laravel\Fortify\Features;
|
|
|
|
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
|
|
|
beforeEach(function (): void {
|
|
$this->skipUnlessFortifyHas(Features::registration());
|
|
});
|
|
|
|
test('registration screen can be rendered', function (): void {
|
|
$response = $this->get(route('register'));
|
|
|
|
$response->assertOk();
|
|
});
|
|
|
|
test('new users can register', function (): void {
|
|
$response = $this->post(route('register.store'), [
|
|
'name' => 'John Doe',
|
|
'email' => 'test@example.com',
|
|
'password' => 'password',
|
|
'password_confirmation' => 'password',
|
|
]);
|
|
|
|
$response->assertSessionHasNoErrors()
|
|
->assertRedirect(route('dashboard', absolute: false));
|
|
|
|
$this->assertAuthenticated();
|
|
});
|