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