mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-02 08:21:09 -08:00
a couple quick things
This commit is contained in:
parent
65ca24f6ae
commit
9d8433bd6d
|
@ -543,6 +543,9 @@ class AssetsController extends Controller
|
|||
$asset->fill($request->validated());
|
||||
|
||||
$asset->user_id = Auth::id();
|
||||
// @todo: verify eol is working as expected - move to request? or do I want this at all?
|
||||
// might just remove this and then use the method from here https://github.com/snipe/snipe-it/pull/13846
|
||||
//$asset->asset_eol_date = $request->validated()['asset_eol_date'] ?? $asset->present()->eol_date();
|
||||
$asset->archived = '0';
|
||||
$asset->physical = '1';
|
||||
$asset->depreciate = '0';
|
||||
|
|
|
@ -40,7 +40,7 @@ class AssetStoreTest extends TestCase
|
|||
'archived' => true,
|
||||
'asset_eol_date' => '2024-06-02',
|
||||
'asset_tag' => 'random_string',
|
||||
'assigned_to' => $userAssigned->id,
|
||||
'assigned_user' => $userAssigned->id, // assigned_to is set in the request, assigned_to isn't set through the api request
|
||||
'company_id' => $company->id,
|
||||
'depreciate' => true,
|
||||
'last_audit_date' => '2023-09-03',
|
||||
|
@ -72,7 +72,7 @@ class AssetStoreTest extends TestCase
|
|||
$this->assertEquals('2024-06-02', $asset->asset_eol_date);
|
||||
$this->assertEquals('random_string', $asset->asset_tag);
|
||||
// @todo: This isn't in the docs but it's in the controller (should it be removed?)
|
||||
$this->assertEquals($userAssigned->id, $asset->assigned_to); //todo: figure this out
|
||||
$this->assertEquals($userAssigned->id, $asset->assigned_to);
|
||||
// @todo: This is not in the docs but it's in the controller
|
||||
$this->assertTrue($asset->company->is($company));
|
||||
// @todo: this is explicitly set 0 in the controller but they docs say they are customizable
|
||||
|
@ -313,6 +313,7 @@ class AssetStoreTest extends TestCase
|
|||
$apiAsset = Asset::find($response['payload']['id']);
|
||||
|
||||
$this->assertTrue($apiAsset->adminuser->is($user));
|
||||
// I think this makes sense, but open to a sanity check
|
||||
$this->assertTrue($asset->assignedAssets()->first()->is($apiAsset));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue