Jul25
Stubbing objects in Radiant
On a recent Radiant customization project, I needed to write some tests for a front-end extension. One situation called for a stub object, so I built out the pathing and created the stub object as I’m used to doing in Rails. In extensions/extension_name/test/mocks/test I created a some_mailer.rb object to mock a mailer model, overriding the mailer’s deliver_mail method: