fix(models): correct UserSetting import namespace and add test coverage

This commit is contained in:
2026-09-07 18:34:51 +02:00
parent 208efbb85d
commit 3502c3e85b
34 changed files with 2497 additions and 2 deletions
+41
View File
@@ -0,0 +1,41 @@
<?php
namespace Tests\Feature\Auth;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class LoginRequestTest extends TestCase
{
use RefreshDatabase;
public function test_throttles_too_many_attempts(): void
{
$user = User::factory()->create();
for ($i = 0; $i < 6; $i++) {
$this->post('/login', [
'email' => $user->email,
'password' => 'wrong-password',
]);
}
$this->post('/login', [
'email' => $user->email,
'password' => 'password',
])->assertSessionHasErrors('email');
}
public function test_successful_login_redirects(): void
{
$user = User::factory()->create();
$this->post('/login', [
'email' => $user->email,
'password' => 'password',
])->assertRedirect(route('dashboard', absolute: false));
$this->assertAuthenticated();
}
}