A free open source IT asset/license management system
added testing to Api check in, renamed other test method
Godfrey M1c67d6802de6
diff --git a/tests/Feature/Checkins/Api/LicenseCheckinTest.php b/tests/Feature/Checkins/Api/LicenseCheckinTest.phpnew file mode 100644index 0000000000..e649b9f43b--- /dev/null+++ b/tests/Feature/Checkins/Api/LicenseCheckinTest.php@@ -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);+ }+}\ No newline at end of filediff --git a/tests/Feature/Checkins/Ui/LicenseCheckinTest.php b/tests/Feature/Checkins/Ui/LicenseCheckinTest.phpindex 5cd906fa35..f1f912cad4 100644--- a/tests/Feature/Checkins/Ui/LicenseCheckinTest.php+++ b/tests/Feature/Checkins/Ui/LicenseCheckinTest.php@@ -20,7 +20,7 @@ class LicenseCheckinTest extends TestCase->assertForbidden();}- public function testNonReassignableLicenseSeatIsUnavailable()+ public function testNonReassignableLicenseSeatCantBeCheckedOut(){$licenseSeat = LicenseSeat::factory()->notReassignable()