fix storage on CI setup
This commit is contained in:
@@ -285,3 +285,28 @@ it('updates user name and email as admin', function (): void {
|
||||
expect($target->email)->toBe('new@example.com');
|
||||
expect($target->email_verified_at)->toBeNull();
|
||||
});
|
||||
|
||||
it('marks email verified when assigning founder role', function (): void {
|
||||
$admin = makeAdmin();
|
||||
$founderRole = Role::firstOrCreate(['name' => 'ROLE_FOUNDER'], ['color' => '#111111']);
|
||||
$target = User::factory()->create([
|
||||
'name' => 'Target',
|
||||
'email' => 'target@example.com',
|
||||
'email_verified_at' => null,
|
||||
]);
|
||||
|
||||
$admin->roles()->syncWithoutDetaching([$founderRole->id]);
|
||||
|
||||
Sanctum::actingAs($admin);
|
||||
$response = $this->patchJson("/api/users/{$target->id}", [
|
||||
'name' => 'Target',
|
||||
'email' => 'target@example.com',
|
||||
'rank_id' => null,
|
||||
'roles' => ['ROLE_FOUNDER'],
|
||||
]);
|
||||
|
||||
$response->assertOk();
|
||||
|
||||
$target->refresh();
|
||||
expect($target->email_verified_at)->not()->toBeNull();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user