Asserting on the job dispatched, and on the job itself

Testing that a controller queued something by starting a worker is slow and flaky; testing it by reading the queue table couples the test to the driver.

public function testPlacingAnOrderQueuesTheReceipt(): void
{
    Queue::fake();

    $this->post('/orders', $this->validPayload())->assertCreated();

    Queue::assertPushed(SendReceipt::class, fn($job) =>
        $job->orderId === Order::latest()->first()->id);
}

// and the job's own test, separately, with no HTTP involved

Splitting it in two is the pattern: one test says the right job was dispatched with the right arguments, the other says the job does the right thing. The closure checking the payload is the part people omit, and without it the test passes when the job is dispatched with the wrong id — which is the bug most likely to occur.