mirror of
https://github.com/discourse/discourse.git
synced 2025-04-01 16:15:46 +08:00
And add tests for empty string & null
This commit is contained in:
parent
4e04c4dddd
commit
b0dbb0ea13
@ -129,7 +129,7 @@ class SiteSetting < ActiveRecord::Base
|
|||||||
|
|
||||||
# we need to think of a way to force users to enter certain settings, this is a minimal config thing
|
# we need to think of a way to force users to enter certain settings, this is a minimal config thing
|
||||||
setting(:notification_email, 'info@discourse.org')
|
setting(:notification_email, 'info@discourse.org')
|
||||||
setting(:email_custom_headers, 'Precedence: bulk|Auto-Submitted: auto-generated')
|
setting(:email_custom_headers, 'Auto-Submitted: auto-generated')
|
||||||
|
|
||||||
setting(:allow_index_in_robots_txt, true)
|
setting(:allow_index_in_robots_txt, true)
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ module Email
|
|||||||
value = header[1].strip
|
value = header[1].strip
|
||||||
result[name] = value if name.length > 0 && value.length > 0
|
result[name] = value if name.length > 0 && value.length > 0
|
||||||
end
|
end
|
||||||
}
|
} if !string.nil?
|
||||||
result
|
result
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -84,6 +84,14 @@ describe Email::MessageBuilder do
|
|||||||
expect(Email::MessageBuilder.custom_headers(custom_headers_string)).to eq(custom_headers_result)
|
expect(Email::MessageBuilder.custom_headers(custom_headers_string)).to eq(custom_headers_result)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "empty headers builder" do
|
||||||
|
expect(Email::MessageBuilder.custom_headers("")).to eq({})
|
||||||
|
end
|
||||||
|
|
||||||
|
it "null headers builder" do
|
||||||
|
expect(Email::MessageBuilder.custom_headers(nil)).to eq({})
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context "header args" do
|
context "header args" do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user