From 2ed9ed5897f5ee559f02797b0a64bb1cac85cf30 Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Thu, 1 Dec 2016 17:22:07 +0100 Subject: [PATCH] Use deliver_method :test for in test environment - thanks to @corny. --- app/models/channel/driver/sendmail.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/models/channel/driver/sendmail.rb b/app/models/channel/driver/sendmail.rb index f94fd9d2c..9b040eb86 100644 --- a/app/models/channel/driver/sendmail.rb +++ b/app/models/channel/driver/sendmail.rb @@ -7,7 +7,14 @@ class Channel::Driver::Sendmail return if Setting.get('import_mode') mail = Channel::EmailBuild.build(attr, notification) - mail.delivery_method :sendmail + mail.delivery_method delivery_method mail.deliver end + + private + + def delivery_method + return :test if Rails.env.test? + :sendmail + end end