- Permissions tests (#97)

* - added some test

* - cr fix

* - cr fix

* - cr fix

* - cr fix
This commit is contained in:
Ewelina Lasowy
2022-03-30 09:54:29 +02:00
committed by GitHub
parent fdbc374d7e
commit ab16af1ca9
3 changed files with 238 additions and 6 deletions

View 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 MonthlyUsageTest extends FeatureTestCase
{
use DatabaseMigrations;
public function testAdministatorCanSeeVacationsMonthlyUsage(): void
{
$admin = User::factory()->admin()->createQuietly();
$this->actingAs($admin)
->get("/monthly-usage")
->assertOk();
}
public function testEmployeeCannotSeeVacationsMonthlyUsage(): void
{
$user = User::factory()->createQuietly();
$this->actingAs($user)
->get("/monthly-usage")
->assertForbidden();
}
}