clean tests & other things

This commit is contained in:
2020-03-25 20:11:29 +01:00
parent 11511039e9
commit 7e5d022aa2
27 changed files with 1497 additions and 187 deletions

View File

@@ -59,4 +59,15 @@ class UserAuthTest extends TestCase
$this->assertCount(1, User::all());
}
/** @test */
public function an_admin_can_fetch_all_users()
{
$this->actingAs($user = factory(User::class)->create(['role' => 2]), 'api');
$anotherUser = factory(User::class)->create();
$response = $this->get('/api/users')->assertStatus(Response::HTTP_OK);
$this->assertCount(2, User::all());
}
}