actingAsForApi(User::factory()->create()) ->getJson(route('api.consumables.selectlist')) ->assertForbidden(); } public function test_consumables_are_returned_for_select_list(): void { [$consumableA, $consumableB] = Consumable::factory()->count(2)->create(); $this->actingAsForApi(User::factory()->createConsumables()->create()) ->getJson(route('api.consumables.selectlist')) ->assertOk() ->assertResponseContainsInResults($consumableA) ->assertResponseContainsInResults($consumableB); } }