Revert "++ amministratori esenti dalla conferma email"
Annullata su richiesta: anche gli amministratori devono confermare l'email. Torna valido il comportamento difc8623f. This reverts commitac78703. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -65,59 +65,14 @@ class ConfermaEmailTest extends TestCase
|
||||
$this->actingAs($utente)->get(route('profile'))->assertOk();
|
||||
}
|
||||
|
||||
public function test_un_amministratore_e_esente_dalla_conferma(): void
|
||||
public function test_un_amministratore_non_confermato_puo_configurare_la_posta(): void
|
||||
{
|
||||
$admin = $this->utente('amministratore');
|
||||
|
||||
$this->assertNull($admin->email_verified_at);
|
||||
$this->assertTrue($admin->hasVerifiedEmail());
|
||||
$this->actingAs($admin)->get(route('settings.edit'))->assertOk();
|
||||
$this->actingAs($admin)->get(route('settings.edit'))->assertRedirect(route('verification.notice'));
|
||||
$this->actingAs($admin)->get(route('posta.edit'))->assertOk()->assertSee('Server di posta');
|
||||
}
|
||||
|
||||
public function test_chi_perde_il_ruolo_di_amministratore_torna_a_dover_confermare(): void
|
||||
{
|
||||
$utente = $this->utente('amministratore');
|
||||
$utente->syncRoles(['operatore']);
|
||||
|
||||
$this->assertFalse($utente->fresh()->hasVerifiedEmail());
|
||||
$this->actingAs($utente->fresh())->get(route('dashboard'))->assertRedirect(route('verification.notice'));
|
||||
}
|
||||
|
||||
public function test_all_amministratore_creato_non_parte_la_conferma(): void
|
||||
{
|
||||
Notification::fake();
|
||||
$admin = $this->utente('amministratore');
|
||||
|
||||
Livewire::actingAs($admin)->test(UsersIndex::class)
|
||||
->set('name', 'Luca Neri')
|
||||
->set('email', 'luca@example.test')
|
||||
->set('password', 'password-di-prova')
|
||||
->set('password_confirmation', 'password-di-prova')
|
||||
->set('selectedRole', 'amministratore')
|
||||
->call('createUser')
|
||||
->assertHasNoErrors();
|
||||
|
||||
$nuovo = User::where('email', 'luca@example.test')->sole();
|
||||
$this->assertTrue($nuovo->hasVerifiedEmail());
|
||||
Notification::assertNothingSentTo($nuovo);
|
||||
}
|
||||
|
||||
public function test_l_amministratore_che_cambia_email_resta_dentro(): void
|
||||
{
|
||||
Notification::fake();
|
||||
$admin = $this->utente('amministratore');
|
||||
|
||||
Livewire::actingAs($admin)->test(Profile::class)
|
||||
->set('name', 'Mario Rossi')
|
||||
->set('email', 'nuovo-admin@example.test')
|
||||
->call('updateProfile')
|
||||
->assertRedirect(route('profile'));
|
||||
|
||||
$this->assertTrue($admin->fresh()->hasVerifiedEmail());
|
||||
Notification::assertNothingSentTo($admin->fresh());
|
||||
}
|
||||
|
||||
public function test_il_link_conferma_anche_senza_essere_entrati(): void
|
||||
{
|
||||
$utente = $this->utente();
|
||||
|
||||
Reference in New Issue
Block a user