mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 19:00:32 -06: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
|
||||
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)
|
||||
|
||||
|
@ -87,7 +87,7 @@ module Email
|
||||
value = header[1].strip
|
||||
result[name] = value if name.length > 0 && value.length > 0
|
||||
end
|
||||
}
|
||||
} if !string.nil?
|
||||
result
|
||||
end
|
||||
|
||||
|
@ -84,6 +84,14 @@ describe Email::MessageBuilder do
|
||||
expect(Email::MessageBuilder.custom_headers(custom_headers_string)).to eq(custom_headers_result)
|
||||
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
|
||||
|
||||
context "header args" do
|
||||
|
Loading…
Reference in New Issue
Block a user