Add extensive controller and model tests
All checks were successful
CI/CD Pipeline / test (push) Successful in 10s
CI/CD Pipeline / deploy (push) Successful in 25s

This commit is contained in:
2026-02-07 22:14:42 +01:00
parent 9c60a8944e
commit 160430e128
39 changed files with 3941 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
<?php
use App\Models\Rank;
use App\Models\User;
it('relates ranks to users', function (): void {
$rank = Rank::create([
'name' => 'Gold',
'badge_type' => 'text',
'badge_text' => 'G',
'color' => '#ffaa00',
]);
$user = User::factory()->create([
'rank_id' => $rank->id,
]);
$rank->load('users');
expect($rank->users)->toHaveCount(1);
expect($rank->users->first()->id)->toBe($user->id);
});