-
-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
75 additions
and
5 deletions.
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
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
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
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
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
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 |
---|---|---|
|
@@ -49,6 +49,42 @@ public function test_new_users_can_register(): void | |
|
||
$this->assertAuthenticated(); | ||
$response->assertRedirect(RouteServiceProvider::HOME); | ||
$user = User::where('email', '[email protected]')->firstOrFail(); | ||
$this->assertSame('UTC', $user->timezone); | ||
} | ||
|
||
public function test_new_users_can_register_and_frontend_can_send_timezone_for_user(): void | ||
{ | ||
$response = $this->post('/register', [ | ||
'name' => 'Test User', | ||
'email' => '[email protected]', | ||
'password' => 'password', | ||
'password_confirmation' => 'password', | ||
'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature(), | ||
'timezone' => 'Europe/Berlin', | ||
]); | ||
|
||
$this->assertAuthenticated(); | ||
$response->assertRedirect(RouteServiceProvider::HOME); | ||
$user = User::where('email', '[email protected]')->firstOrFail(); | ||
$this->assertSame('Europe/Berlin', $user->timezone); | ||
} | ||
|
||
public function test_new_users_can_register_and_ignores_invalid_timezones_from_frontend(): void | ||
{ | ||
$response = $this->post('/register', [ | ||
'name' => 'Test User', | ||
'email' => '[email protected]', | ||
'password' => 'password', | ||
'password_confirmation' => 'password', | ||
'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature(), | ||
'timezone' => 'Unknown timezone', | ||
]); | ||
|
||
$this->assertAuthenticated(); | ||
$response->assertRedirect(RouteServiceProvider::HOME); | ||
$user = User::where('email', '[email protected]')->firstOrFail(); | ||
$this->assertSame('UTC', $user->timezone); | ||
} | ||
|
||
public function test_new_users_can_not_register_if_user_with_email_already_exists(): void | ||
|
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 |
---|---|---|
|
@@ -42,6 +42,7 @@ public function test_get_key_attach_to_existing_creates_model_if_not_existing(): | |
'email' => '[email protected]', | ||
], [ | ||
'name' => 'Test', | ||
'timezone' => 'UTC', | ||
]); | ||
|
||
// Assert | ||
|