From 1c67d6802de6cbf71d0a85633184696bf942c834 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Mon, 27 Jan 2025 12:18:24 -0800 Subject: [PATCH] added testing to Api check in, renamed other test method --- .../Checkins/Api/LicenseCheckinTest.php | 27 +++++++++++++++++++ .../Checkins/Ui/LicenseCheckinTest.php | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 tests/Feature/Checkins/Api/LicenseCheckinTest.php diff --git a/tests/Feature/Checkins/Api/LicenseCheckinTest.php b/tests/Feature/Checkins/Api/LicenseCheckinTest.php new file mode 100644 index 000000000000..e649b9f43b95 --- /dev/null +++ b/tests/Feature/Checkins/Api/LicenseCheckinTest.php @@ -0,0 +1,27 @@ +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 file diff --git a/tests/Feature/Checkins/Ui/LicenseCheckinTest.php b/tests/Feature/Checkins/Ui/LicenseCheckinTest.php index 5cd906fa3576..f1f912cad454 100644 --- a/tests/Feature/Checkins/Ui/LicenseCheckinTest.php +++ b/tests/Feature/Checkins/Ui/LicenseCheckinTest.php @@ -20,7 +20,7 @@ public function testCheckingInLicenseRequiresCorrectPermission() ->assertForbidden(); } - public function testNonReassignableLicenseSeatIsUnavailable() + public function testNonReassignableLicenseSeatCantBeCheckedOut() { $licenseSeat = LicenseSeat::factory() ->notReassignable()