mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 19:30:48 +08:00
FIX: Allow sending test e-mails to any email address when disable_email is set to non-staff (#6792)
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user