summaryrefslogtreecommitdiffstats
path: root/test/unit/setting_test.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2019-02-12 23:35:05 +0000
committerGo MAEDA <maeda@farend.jp>2019-02-12 23:35:05 +0000
commitb0b8978ff84ef25dfa8efa842a8643377bbbe266 (patch)
tree15bc5e6a240d8bc1dc2d68e76fb30d2ab8563adb /test/unit/setting_test.rb
parent58ea5b9d537234236c3fd95aaec6350658e75499 (diff)
downloadredmine-b0b8978ff84ef25dfa8efa842a8643377bbbe266.tar.gz
redmine-b0b8978ff84ef25dfa8efa842a8643377bbbe266.zip
Fix: Mail handler does not ignore emails sent from emission email address if Setting.mail_from includes display name (#30785).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@17862 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/setting_test.rb')
-rw-r--r--test/unit/setting_test.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/unit/setting_test.rb b/test/unit/setting_test.rb
index 5eed249f1..710d9581e 100644
--- a/test/unit/setting_test.rb
+++ b/test/unit/setting_test.rb
@@ -112,6 +112,23 @@ class SettingTest < ActiveSupport::TestCase
end
end
+ def test_mail_from_address
+ mail_from_strings = [
+ 'joe@example.com',
+ '<joe@example.com>',
+ 'Joe Bloggs <joe@example.com>',
+ 'display_name@example.com <joe@example.com>',
+ 'joe@example.com (Joe Bloggs)',
+ 'joe@example.com (display_name@example.com)'
+ ]
+
+ mail_from_strings.each do |from_value|
+ with_settings :mail_from => from_value do
+ assert_equal 'joe@example.com', Setting.mail_from_address
+ end
+ end
+ end
+
def test_setting_serialied_as_binary_should_be_loaded_as_utf8_encoded_strings
yaml = <<-YAML
---