A common challenge in testing is not HOW to test something, but WHAT you can test. I have made a list of all the things I like to test in my applications.
Testing page response is one of the simplest tests to write; still, it is extremely useful.
This test is similar to the first page response test.
it('sends email to podcast author', function() { Mail::fake(); $podcast = Podcast::factory()->create(); $this->post(route('publish-podcast', $podcast)); Mail::assertSent(PodcastPublishedMail::class); }); Always run the Mail::fake() method at the beginning of your tests when testing emails.