mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
added testing to Api check in, renamed other test method
This commit is contained in:
parent
5da8c86ec7
commit
1c67d6802d
27
tests/Feature/Checkins/Api/LicenseCheckinTest.php
Normal file
27
tests/Feature/Checkins/Api/LicenseCheckinTest.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
namespace Tests\Feature\Checkins\Api;
|
||||
|
||||
use App\Models\LicenseSeat;
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class LicenseCheckinTest extends TestCase
|
||||
{
|
||||
|
||||
public function testUnreassignableLicenseSeatMarkedUponCheckin()
|
||||
{
|
||||
$licenseSeat = LicenseSeat::factory()
|
||||
->notReassignable()
|
||||
->assignedToUser()
|
||||
->create();
|
||||
|
||||
$this->assertEquals(false, $licenseSeat->unreassignable_seat);
|
||||
|
||||
$this->actingAs(User::factory()->checkoutLicenses()->create())
|
||||
->post(route('licenses.checkin.save', $licenseSeat));
|
||||
|
||||
$licenseSeat->refresh();
|
||||
|
||||
$this->assertEquals(true, $licenseSeat->unreassignable_seat);
|
||||
}
|
||||
}
|
|
@ -20,7 +20,7 @@ class LicenseCheckinTest extends TestCase
|
|||
->assertForbidden();
|
||||
}
|
||||
|
||||
public function testNonReassignableLicenseSeatIsUnavailable()
|
||||
public function testNonReassignableLicenseSeatCantBeCheckedOut()
|
||||
{
|
||||
$licenseSeat = LicenseSeat::factory()
|
||||
->notReassignable()
|
||||
|
|
Loading…
Reference in a new issue