Skip to content

Commit

Permalink
added testing to Api check in, renamed other test method
Browse files Browse the repository at this point in the history
  • Loading branch information
Godmartinz committed Jan 27, 2025
1 parent 5da8c86 commit 1c67d68
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
27 changes: 27 additions & 0 deletions tests/Feature/Checkins/Api/LicenseCheckinTest.php
Original file line number Diff line number Diff line change
@@ -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);
}
}
2 changes: 1 addition & 1 deletion tests/Feature/Checkins/Ui/LicenseCheckinTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function testCheckingInLicenseRequiresCorrectPermission()
->assertForbidden();
}

public function testNonReassignableLicenseSeatIsUnavailable()
public function testNonReassignableLicenseSeatCantBeCheckedOut()
{
$licenseSeat = LicenseSeat::factory()
->notReassignable()
Expand Down

0 comments on commit 1c67d68

Please sign in to comment.