Backfill test

This commit is contained in:
Marcus Moore 2025-01-21 10:24:15 -08:00
parent 6a35fa7ba3
commit e733d2a5d0
No known key found for this signature in database

View file

@ -0,0 +1,26 @@
<?php
namespace Tests\Feature\Assets\Ui;
use App\Models\Asset;
use App\Models\User;
use Tests\TestCase;
class ShowAssetTest extends TestCase
{
public function testPageForAssetWithMissingModelStillRenders()
{
$asset = Asset::factory()->create();
$asset->model_id = null;
$asset->forceSave();
$asset->refresh();
$this->assertNull($asset->fresh()->model_id, 'This test needs model_id to be null to be helpful.');
$this->actingAs(User::factory()->superuser()->create())
->get(route('hardware.show', $asset))
->assertOk();
}
}