1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-07-22 17:18:37 +00:00

Disabled delete button for the logged user

To avoid some bad things to happen…
This commit is contained in:
Jeremy Benoist 2016-10-02 13:21:45 +02:00
parent eb4142e0af
commit ccc7faec09
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C
2 changed files with 12 additions and 1 deletions

View file

@ -68,4 +68,15 @@ class ManageControllerTest extends WallabagCoreTestCase
// Check the user has been delete on the list
$this->assertNotRegExp('/Foo User/', $client->getResponse()->getContent());
}
public function testDeleteDisabledForLoggedUser()
{
$this->logInAs('admin');
$client = $this->getClient();
$crawler = $client->request('GET', '/users/'.$this->getLoggedInUserId().'/edit');
$disabled = $crawler->selectButton('user.form.delete')->extract('disabled');
$this->assertEquals('disabled', $disabled[0]);
}
}