mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-07 23:03:00 +03:00
My Account: Updated and started adding to tests
- Updated existing tests now affected by my-account changes. - Updated some existing tests to more accuractly check the scenario. - Updated some code styling in SocialController. - Fixed redirects for social account flows to fit my-account. - Added test for social account attaching. - Added test for api token redirect handling.
This commit is contained in:
@@ -44,14 +44,12 @@ class RolePermissionsTest extends TestCase
|
||||
|
||||
public function test_user_cannot_change_email_unless_they_have_manage_users_permission()
|
||||
{
|
||||
$userProfileUrl = '/settings/users/' . $this->user->id;
|
||||
$originalEmail = $this->user->email;
|
||||
$this->actingAs($this->user);
|
||||
|
||||
$resp = $this->get($userProfileUrl)
|
||||
->assertOk();
|
||||
$resp = $this->get('/my-account/profile')->assertOk();
|
||||
$this->withHtml($resp)->assertElementExists('input[name=email][disabled]');
|
||||
$this->put($userProfileUrl, [
|
||||
$this->put('/my-account/profile', [
|
||||
'name' => 'my_new_name',
|
||||
'email' => 'new_email@example.com',
|
||||
]);
|
||||
@@ -63,11 +61,12 @@ class RolePermissionsTest extends TestCase
|
||||
|
||||
$this->permissions->grantUserRolePermissions($this->user, ['users-manage']);
|
||||
|
||||
$resp = $this->get($userProfileUrl)
|
||||
->assertOk();
|
||||
$this->withHtml($resp)->assertElementNotExists('input[name=email][disabled]')
|
||||
$resp = $this->get('/my-account/profile')->assertOk();
|
||||
$this->withHtml($resp)
|
||||
->assertElementNotExists('input[name=email][disabled]')
|
||||
->assertElementExists('input[name=email]');
|
||||
$this->put($userProfileUrl, [
|
||||
|
||||
$this->put('/my-account/profile', [
|
||||
'name' => 'my_new_name_2',
|
||||
'email' => 'new_email@example.com',
|
||||
]);
|
||||
|
Reference in New Issue
Block a user