feature: remove change password for admin
This commit is contained in:
@@ -197,6 +197,31 @@ class LoginNotificationTest extends TestCase
|
||||
$this->assertTrue(\Illuminate\Support\Facades\Auth::check());
|
||||
}
|
||||
|
||||
public function test_admin_first_login_does_not_redirect_to_change_password(): void
|
||||
{
|
||||
$admin = User::create([
|
||||
'msnv' => 5007,
|
||||
'name' => 'First Login Admin',
|
||||
'mail' => 'first_admin@example.com',
|
||||
'pass' => md5('password123'),
|
||||
'departments' => 1,
|
||||
'role' => User::ROLE_ADMIN,
|
||||
'status' => User::STATUS_ACTIVE,
|
||||
'card' => 10,
|
||||
'flag_send' => User::FLAG_SEND_ENABLED,
|
||||
'first_login' => User::FIRST_LOGIN_TRUE,
|
||||
]);
|
||||
|
||||
$response = $this->post('/login', [
|
||||
'mail' => 'first_admin@example.com',
|
||||
'password' => 'password123',
|
||||
]);
|
||||
|
||||
$response->assertRedirect(route('admin.dashboard'));
|
||||
$response->assertSessionMissing('dialog_first_login');
|
||||
$this->assertTrue(\Illuminate\Support\Facades\Auth::check());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test Case 6: Brute-force protection
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user