Complete a scenario

This commit is contained in:
Marcus Moore 2024-05-22 13:23:49 -07:00
parent 5d368990dc
commit 8ca882d1c8
No known key found for this signature in database
2 changed files with 1 additions and 2 deletions

View file

@ -829,7 +829,6 @@ class AssetsController extends Controller
$error_payload['target_type'] = 'location';
} elseif (request('checkout_to_type') == 'asset') {
// @todo: test this code path
$target = Asset::where('id', '!=', $asset_id)->find(request('assigned_asset'));
// Override with the asset's location_id if it has one
$asset->location_id = (($target) && (isset($target->location_id))) ? $target->location_id : '';

View file

@ -142,7 +142,7 @@ class AssetCheckoutTest extends TestCase
['checkout_type' => $type, 'target' => $target, 'expected_location' => $expectedLocation] = $data();
$newStatus = Statuslabel::factory()->readyToDeploy()->create();
$asset = Asset::factory()->create();
$asset = Asset::factory()->forLocation()->create();
$admin = User::factory()->checkoutAssets()->create();
$this->actingAsForApi($admin)