Add admin-managed user creation
This commit is contained in:
@@ -5,6 +5,7 @@ namespace Tests\Feature\Auth;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\RateLimiter;
|
||||
use Inertia\Testing\AssertableInertia as Assert;
|
||||
use Laravel\Fortify\Features;
|
||||
use Tests\TestCase;
|
||||
|
||||
@@ -32,6 +33,23 @@ class AuthenticationTest extends TestCase
|
||||
$response->assertRedirect(route('dashboard', absolute: false));
|
||||
}
|
||||
|
||||
public function test_users_who_must_change_their_password_are_redirected_to_security_settings_after_login()
|
||||
{
|
||||
$user = User::factory()->create([
|
||||
'must_change_password_on_next_login' => true,
|
||||
]);
|
||||
|
||||
$response = $this->followingRedirects()->post(route('login.store'), [
|
||||
'email' => $user->email,
|
||||
'password' => 'password',
|
||||
]);
|
||||
|
||||
$this->assertAuthenticated();
|
||||
$response->assertInertia(fn (Assert $page) => $page
|
||||
->component('auth/ConfirmPassword'),
|
||||
);
|
||||
}
|
||||
|
||||
public function test_users_with_two_factor_enabled_are_redirected_to_two_factor_challenge()
|
||||
{
|
||||
$this->skipUnlessFortifyFeature(Features::twoFactorAuthentication());
|
||||
|
||||
Reference in New Issue
Block a user