2 exercises work on this concept, by writing code in the browser.
In Practice
- Don't send the email of a cancelled order A queued mailable now honours #[DeleteWhenMissingModels]: if its order has disappeared in the meantime, the job is removed instead of failing.
- Checking that an email is sent only once assertSentOnce() and assertSentOnDemandOnce(): the Mail and Notification fakes finally say “exactly once” in one word.