actingAs($this->operationalUser(), 'sanctum'); UserPosition::factory()->count(2)->create(); $this->getJson('/api/user-positions') ->assertOk() ->assertJsonStructure(['message', 'data' => [['id', 'value']]]); } public function test_show_returns_a_single_position(): void { $this->actingAs($this->operationalUser(), 'sanctum'); $position = UserPosition::factory()->create(); $this->getJson("/api/user-positions/{$position->id}") ->assertOk() ->assertJsonPath('data.id', $position->id) ->assertJsonPath('data.value', $position->value); } // --- Gating --------------------------------------------------------------- public function test_guests_can_read_positions(): void { UserPosition::factory()->create(); $this->getJson('/api/user-positions')->assertOk(); } }