FIX: Amend broken Mailgun API key check (#26206)
This commit is contained in:
parent
78bafb331a
commit
e2ee70c4e2
|
@ -5,7 +5,7 @@ class ProblemCheck::MissingMailgunApiKey < ProblemCheck
|
||||||
|
|
||||||
def call
|
def call
|
||||||
return no_problem if !SiteSetting.reply_by_email_enabled
|
return no_problem if !SiteSetting.reply_by_email_enabled
|
||||||
return no_problem if !ActionMailer::Base.smtp_settings.dig(:address, "smtp.mailgun.org")
|
return no_problem if ActionMailer::Base.smtp_settings[:address] != "smtp.mailgun.org"
|
||||||
return no_problem if SiteSetting.mailgun_api_key.present?
|
return no_problem if SiteSetting.mailgun_api_key.present?
|
||||||
|
|
||||||
problem
|
problem
|
||||||
|
|
|
@ -6,7 +6,7 @@ RSpec.describe ProblemCheck::MissingMailgunApiKey do
|
||||||
describe ".call" do
|
describe ".call" do
|
||||||
before do
|
before do
|
||||||
SiteSetting.stubs(reply_by_email_enabled: replies_enabled)
|
SiteSetting.stubs(reply_by_email_enabled: replies_enabled)
|
||||||
ActionMailer::Base.smtp_settings.stubs(dig: mailgun_address)
|
ActionMailer::Base.stubs(smtp_settings: { address: mailgun_address })
|
||||||
SiteSetting.stubs(mailgun_api_key: api_key)
|
SiteSetting.stubs(mailgun_api_key: api_key)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ RSpec.describe ProblemCheck::MissingMailgunApiKey do
|
||||||
|
|
||||||
context "when using Mailgun without an API key" do
|
context "when using Mailgun without an API key" do
|
||||||
let(:replies_enabled) { true }
|
let(:replies_enabled) { true }
|
||||||
let(:mailgun_address) { "foo" }
|
let(:mailgun_address) { "smtp.mailgun.org" }
|
||||||
let(:api_key) { nil }
|
let(:api_key) { nil }
|
||||||
|
|
||||||
it do
|
it do
|
||||||
|
|
Loading…
Reference in New Issue