Skip to content

A free open source IT asset/license management system

Implement test

Marcus Moore482ebfbb68bd
diff --git a/tests/Feature/Checkouts/AssetCheckoutTest.php b/tests/Feature/Checkouts/AssetCheckoutTest.php
index 7f3de6bf11..fd0408b452 100644
--- a/tests/Feature/Checkouts/AssetCheckoutTest.php
+++ b/tests/Feature/Checkouts/AssetCheckoutTest.php
@@ -63,8 +63,16 @@ class AssetCheckoutTest extends TestCase
public function testAssetCannotBeCheckedOutToItself()
{
- // @todo:
- $this->markTestIncomplete();
+ $asset = Asset::factory()->create();
+
+ $this->actingAs(User::factory()->checkoutAssets()->create())
+ ->post(route('hardware.checkout.store', $asset), [
+ 'checkout_to_type' => 'asset',
+ 'assigned_asset' => $asset->id,
+ ])
+ ->assertSessionHas('error');
+
+ Event::assertNotDispatched(CheckoutableCheckedOut::class);
}
public function testValidationWhenCheckingOutAsset()