From b9792241ca411d386e503a5ffd64ad8e773131ac Mon Sep 17 00:00:00 2001 From: taitus Date: Wed, 29 Jan 2020 16:15:49 +0100 Subject: [PATCH] Allow always send forward email The new key only block notifications emails from Dashboard::Mailer. Fix specs. --- app/mailers/dashboard/mailer.rb | 2 +- spec/mailers/dashboard/mailer_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/mailers/dashboard/mailer.rb b/app/mailers/dashboard/mailer.rb index f90b683d5..669e51815 100644 --- a/app/mailers/dashboard/mailer.rb +++ b/app/mailers/dashboard/mailer.rb @@ -1,6 +1,6 @@ class Dashboard::Mailer < ApplicationMailer layout "mailer" - after_action :check_deliverability + after_action :check_deliverability, except: [:forward] def forward(proposal) @proposal = proposal diff --git a/spec/mailers/dashboard/mailer_spec.rb b/spec/mailers/dashboard/mailer_spec.rb index 812c3cfe5..1464d6872 100644 --- a/spec/mailers/dashboard/mailer_spec.rb +++ b/spec/mailers/dashboard/mailer_spec.rb @@ -20,12 +20,12 @@ describe Dashboard::Mailer do ActionMailer::Base.deliveries.clear end - it "Disables email delivery using setting" do + it "Disables notification emails delivery using setting, does not affect the forward email" do Setting["feature.dashboard.notification_emails"] = nil Dashboard::Mailer.forward(proposal).deliver_now - expect(ActionMailer::Base.deliveries.count).to eq(0) + expect(ActionMailer::Base.deliveries.count).to eq(1) end it "sends forward email" do