Added tests
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
41fb058adb
commit
04f8ebb4d8
1 changed files with 23 additions and 0 deletions
|
@ -14,4 +14,27 @@ class ShowLocationTest extends TestCase
|
|||
->get(route('locations.show', Location::factory()->create()))
|
||||
->assertOk();
|
||||
}
|
||||
|
||||
public function testDeniesAccessToRegularUser()
|
||||
{
|
||||
$this->actingAs(User::factory()->create())
|
||||
->get(route('locations.show', Location::factory()->create()))
|
||||
->assertStatus(403)
|
||||
->assertForbidden();
|
||||
}
|
||||
|
||||
public function testDeniesPrintAccessToRegularUser()
|
||||
{
|
||||
$this->actingAs(User::factory()->create())
|
||||
->get(route('locations.print_all_assigned', Location::factory()->create()))
|
||||
->assertStatus(403)
|
||||
->assertForbidden();
|
||||
}
|
||||
|
||||
public function testPageRendersForSuperAdmin()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('locations.print_all_assigned', Location::factory()->create()))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue