Skip to content

Commit

Permalink
Test basic fetch of users page.
Browse files Browse the repository at this point in the history
  • Loading branch information
edwh committed Aug 2, 2021
1 parent 61b2b91 commit ca37169
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions tests/Feature/Users/UserAdminTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,39 @@

class UserAdminTest extends TestCase
{
public function testUsersPage() {
public function provider()
{
return [
[
'Administrator', TRUE
],
[
'NetworkCoordinator', FALSE
],
[
'Host', FALSE
],
[
'Restarter', FALSE
],
];
}

/**
*@dataProvider provider
*/
public function testUsersPage($cansee) {
// Fetch the list of all users and check that we're in it.
$admin = factory(User::class)->states('Administrator')->create();
$this->actingAs($admin);

$response = $this->get('/user/all');
$response->assertSee('Create new user');
$response->assertSee($admin->name);

if ($cansee) {
$response->assertSee('Create new user');
$response->assertSee($admin->name);
} else {
$response->assertDontSee('Create new user');
}
}
}

0 comments on commit ca37169

Please sign in to comment.