Skip to content

Commit

Permalink
Backfill test
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusmoore committed Jan 21, 2025
1 parent 6a35fa7 commit e733d2a
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/Feature/Assets/Ui/ShowAssetTest.php
Original file line number Diff line number Diff line change
@@ -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();
}
}

0 comments on commit e733d2a

Please sign in to comment.