Skip to content

Commit e733d2a

Browse files
committed
Backfill test
1 parent 6a35fa7 commit e733d2a

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
namespace Tests\Feature\Assets\Ui;
4+
5+
use App\Models\Asset;
6+
use App\Models\User;
7+
use Tests\TestCase;
8+
9+
class ShowAssetTest extends TestCase
10+
{
11+
public function testPageForAssetWithMissingModelStillRenders()
12+
{
13+
$asset = Asset::factory()->create();
14+
15+
$asset->model_id = null;
16+
$asset->forceSave();
17+
18+
$asset->refresh();
19+
20+
$this->assertNull($asset->fresh()->model_id, 'This test needs model_id to be null to be helpful.');
21+
22+
$this->actingAs(User::factory()->superuser()->create())
23+
->get(route('hardware.show', $asset))
24+
->assertOk();
25+
}
26+
}

0 commit comments

Comments
 (0)