-
-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make email validation on registration stricter
- Loading branch information
Showing
2 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,6 +63,36 @@ public function test_new_users_can_register(): void | |
Event::assertNotDispatched(NewsletterRegistered::class); | ||
} | ||
|
||
public function test_new_user_can_not_register_with_likely_invalid_domain(): void | ||
{ | ||
// Act | ||
$response = $this->post('/register', [ | ||
'name' => 'Test User', | ||
'email' => 'peter.test@gmail', | ||
'password' => 'password', | ||
'password_confirmation' => 'password', | ||
'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature(), | ||
]); | ||
|
||
// Assert | ||
$response->assertInvalid(['email']); | ||
} | ||
|
||
public function test_new_user_can_register_with_uppercase_email(): void | ||
{ | ||
// Act | ||
$response = $this->post('/register', [ | ||
'name' => 'Test User', | ||
'email' => '[email protected] ', | ||
'password' => 'password', | ||
'password_confirmation' => 'password', | ||
'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature(), | ||
]); | ||
|
||
// Assert | ||
$response->assertValid(['email']); | ||
} | ||
|
||
public function test_new_users_can_consent_to_newsletter_during_registration(): void | ||
{ | ||
// Arrange | ||
|