snipe_it/tests/Feature/Checkins/Ui/LicenseCheckinTest.php
2024-12-16 17:45:10 -08:00

26 lines
723 B
PHP

<?php
namespace Tests\Feature\Checkins\Ui;
use App\Models\LicenseSeat;
use App\Models\User;
use Tests\TestCase;
class LicenseCheckinTest extends TestCase
{
public function testCheckingInLicenseRequiresCorrectPermission()
{
$this->actingAs(User::factory()->create())
->post(route('licenses.checkin.save', [
'licenseId' => LicenseSeat::factory()->assignedToUser()->create()->id,
]))
->assertForbidden();
}
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('licenses.checkin', LicenseSeat::factory()->assignedToUser()->create()->id))
->assertOk();
}
}