- Permissions tests (#97)
* - added some test * - cr fix * - cr fix * - cr fix * - cr fix
This commit is contained in:
32
tests/Feature/VacationCalendarTest.php
Normal file
32
tests/Feature/VacationCalendarTest.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Tests\FeatureTestCase;
|
||||
use Toby\Eloquent\Models\User;
|
||||
|
||||
class VacationCalendarTest extends FeatureTestCase
|
||||
{
|
||||
use DatabaseMigrations;
|
||||
|
||||
public function testAdministrativeApproverCanDownloadTimesheet(): void
|
||||
{
|
||||
$administrativeApprover = User::factory()->administrativeApprover()->createQuietly();
|
||||
|
||||
$this->actingAs($administrativeApprover)
|
||||
->get("/timesheet/january")
|
||||
->assertOk();
|
||||
}
|
||||
|
||||
public function testEmployeeCannotDownloadTimesheet(): void
|
||||
{
|
||||
$user = User::factory()->createQuietly();
|
||||
|
||||
$this->actingAs($user)
|
||||
->get("/timesheet/january")
|
||||
->assertForbidden();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user