FIX: Allow sending test e-mails to any email address when disable_email is set to non-staff (#6792)

This commit is contained in:
Rishabh
2018-12-18 20:42:05 +05:30
committed by Régis Hanol
parent 32784ad11a
commit c279792130
5 changed files with 5 additions and 12 deletions

View File

@ -27,10 +27,10 @@ describe Email::Sender do
context "disable_emails is enabled for non-staff users" do
before { SiteSetting.disable_emails = "non-staff" }
it "doesn't deliver mail to normal user" do
Mail::Message.any_instance.expects(:deliver_now).never
it "delivers mail to normal user" do
Mail::Message.any_instance.expects(:deliver_now).once
message = Mail::Message.new(to: user.email, body: "hello")
expect(Email::Sender.new(message, :hello).send).to eq(nil)
Email::Sender.new(message, :hello).send
end
it "delivers mail to staff user" do