How to Mock ActionMailer

The Rails ActionMailer is a pretty useful tool.Unfortunately, it's extremely awkward to mock for tests.Since these emails are critical to our business I spent some time looking at how to write clean test to make sure my mailers are called when they should be.The Business CaseSo we're working on a Point of Sale for the the Frosty Treat in Kengsington PEI. The CEO is all about data and dopamine rushes, so they want to get an email every time a banana gets split...for whatever reason.Here's what our test should roughly look like:.
How to Mock ActionMailer #ruby #rubydeveloper #rubyonrails https://rubyonrails.ba/single/how-to-mock-actionmailer

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles