File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ public function create(array $input): User
43
43
'email ' => [
44
44
'required ' ,
45
45
'string ' ,
46
- 'email ' ,
46
+ 'email:rfc,strict ' ,
47
47
'max:255 ' ,
48
48
UniqueEloquent::make (User::class, 'email ' , function (Builder $ builder ): Builder {
49
49
/** @var Builder<User> $builder */
Original file line number Diff line number Diff line change @@ -63,6 +63,36 @@ public function test_new_users_can_register(): void
63
63
Event::assertNotDispatched (NewsletterRegistered::class);
64
64
}
65
65
66
+ public function test_new_user_can_not_register_with_likely_invalid_domain (): void
67
+ {
68
+ // Act
69
+ $ response = $ this ->post ('/register ' , [
70
+ 'name ' => 'Test User ' ,
71
+ 'email ' => 'peter.test@gmail ' ,
72
+ 'password ' => 'password ' ,
73
+ 'password_confirmation ' => 'password ' ,
74
+ 'terms ' => Jetstream::hasTermsAndPrivacyPolicyFeature (),
75
+ ]);
76
+
77
+ // Assert
78
+ $ response ->assertInvalid (['email ' ]);
79
+ }
80
+
81
+ public function test_new_user_can_register_with_uppercase_email (): void
82
+ {
83
+ // Act
84
+ $ response = $ this ->post ('/register ' , [
85
+ 'name ' => 'Test User ' ,
86
+ 'email ' => 'PETER.test@gmail.com ' ,
87
+ 'password ' => 'password ' ,
88
+ 'password_confirmation ' => 'password ' ,
89
+ 'terms ' => Jetstream::hasTermsAndPrivacyPolicyFeature (),
90
+ ]);
91
+
92
+ // Assert
93
+ $ response ->assertValid (['email ' ]);
94
+ }
95
+
66
96
public function test_new_users_can_consent_to_newsletter_during_registration (): void
67
97
{
68
98
// Arrange
You can’t perform that action at this time.
0 commit comments