mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 16:22:14 +00:00
Disable account registering from disabled email provider
This commit is contained in:
@@ -60,6 +60,47 @@ class SignFlowTest extends TestCase
|
||||
Notification::assertTimesSent(1, VerifyEmail::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_try_register_when_registration_is_disabled()
|
||||
{
|
||||
Setting::create([
|
||||
'name' => 'registration',
|
||||
'value' => 0,
|
||||
]);
|
||||
|
||||
$this->postJson('api/register', [
|
||||
'email' => 'john@doe.com',
|
||||
'password' => 'SecretPassword',
|
||||
'password_confirmation' => 'SecretPassword',
|
||||
'name' => 'John Doe',
|
||||
])->assertStatus(401);
|
||||
|
||||
$this->assertDatabaseMissing('users', [
|
||||
'email' => 'john@doe.com',
|
||||
'email_verified_at' => null,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_try_register_from_disabled_email_provider()
|
||||
{
|
||||
$this->postJson('api/register', [
|
||||
'email' => 'john@maildrop.cc',
|
||||
'password' => 'SecretPassword',
|
||||
'password_confirmation' => 'SecretPassword',
|
||||
'name' => 'John Doe',
|
||||
])->assertStatus(422);
|
||||
|
||||
$this->assertDatabaseMissing('users', [
|
||||
'email' => 'john@doe.com',
|
||||
'email_verified_at' => null,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user