Skip to content

Commit a539769

Browse files
committed
Use correct id
1 parent 1be7508 commit a539769

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

tests/Feature/Checkins/Ui/AccessoryCheckinTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ public function testCheckingInAccessoryRequiresCorrectPermission()
2525

2626
public function testPageRenders()
2727
{
28+
$accessory = Accessory::factory()->checkedOutToUser()->create();
29+
2830
$this->actingAs(User::factory()->superuser()->create())
29-
->get(route('accessories.checkin.show', Accessory::factory()->checkedOutToUser()->create()->id))
31+
->get(route('accessories.checkin.show', $accessory->checkouts->first()->id))
3032
->assertOk();
3133
}
3234

tests/Feature/Checkins/Ui/ComponentCheckinTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,12 @@ public function testCheckingInComponentRequiresCorrectPermission()
2424

2525
public function testPageRenders()
2626
{
27+
$component = Component::factory()->checkedOutToAsset()->create();
28+
29+
$componentAsset = DB::table('components_assets')->where('component_id', $component->id)->first();
30+
2731
$this->actingAs(User::factory()->superuser()->create())
28-
->get(route('components.checkin.show', Component::factory()->checkedOutToAsset()->create()->id))
32+
->get(route('components.checkin.show', $componentAsset->id))
2933
->assertOk();
3034
}
3135

0 commit comments

Comments
 (0)