mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Remove the use of stubs and mocks in Jobs::UserEmail tests.
We can only be sure that an email is sent when we get a mailer in `ActionMailer::Deliveries`. A couple of tests were actually incorrect because it didn't flow through our email sender where there are more conditions in determining whether an email is sent or not.
This commit is contained in:
@@ -21,8 +21,13 @@ module Email
|
||||
@user = user
|
||||
end
|
||||
|
||||
def send
|
||||
return if SiteSetting.disable_emails == "yes" && @email_type.to_s != "admin_login"
|
||||
def send(is_critical: false)
|
||||
if SiteSetting.disable_emails == "yes" &&
|
||||
@email_type.to_s != "admin_login" &&
|
||||
!is_critical
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
return if ActionMailer::Base::NullMail === @message
|
||||
return if ActionMailer::Base::NullMail === (@message.message rescue nil)
|
||||
|
||||
Reference in New Issue
Block a user