File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ public function create(array $input): User
4343 'email ' => [
4444 'required ' ,
4545 'string ' ,
46- 'email ' ,
46+ 'email:rfc,strict ' ,
4747 'max:255 ' ,
4848 UniqueEloquent::make (User::class, 'email ' , function (Builder $ builder ): Builder {
4949 /** @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
6363 Event::assertNotDispatched (NewsletterRegistered::class);
6464 }
6565
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+
6696 public function test_new_users_can_consent_to_newsletter_during_registration (): void
6797 {
6898 // Arrange
You can’t perform that action at this time.
0 commit comments