diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-03-01 15:32:34 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-03-01 15:32:34 +0000 |
commit | ab46c52d4a3e993d3ca59cca976e1235ee2e2ed7 (patch) | |
tree | 84fd57049aad6690562bf44efae0e3cc130301ee /test | |
parent | 2df6c99e675d3edaa2aac2e473cfee2304afa5cf (diff) | |
download | redmine-ab46c52d4a3e993d3ca59cca976e1235ee2e2ed7.tar.gz redmine-ab46c52d4a3e993d3ca59cca976e1235ee2e2ed7.zip |
MailHandler: fixed that sender's fullname is not unquoted (#10334).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9043 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/fixtures/mail_handler/fullname_of_sender_as_utf8_encoded.eml | 5 | ||||
-rw-r--r-- | test/unit/mail_handler_test.rb | 15 |
2 files changed, 20 insertions, 0 deletions
diff --git a/test/fixtures/mail_handler/fullname_of_sender_as_utf8_encoded.eml b/test/fixtures/mail_handler/fullname_of_sender_as_utf8_encoded.eml new file mode 100644 index 000000000..ac14b44f9 --- /dev/null +++ b/test/fixtures/mail_handler/fullname_of_sender_as_utf8_encoded.eml @@ -0,0 +1,5 @@ +From: =?utf-8?b?w4TDpCDDlsO2?= <foo@example.org> +Subject: foo +Content-Type: text/plain; charset=utf-8 + +testing user creation with quoted From-header diff --git a/test/unit/mail_handler_test.rb b/test/unit/mail_handler_test.rb index 92dc43113..218625f74 100644 --- a/test/unit/mail_handler_test.rb +++ b/test/unit/mail_handler_test.rb @@ -576,6 +576,21 @@ class MailHandlerTest < ActiveSupport::TestCase assert_equal 'foo+bar@example.net', user.mail end + def test_new_user_with_utf8_encoded_fullname_should_be_decoded + assert_difference 'User.count' do + issue = submit_email( + 'fullname_of_sender_as_utf8_encoded.eml', + :issue => {:project => 'ecookbook'}, + :unknown_user => 'create' + ) + end + + user = User.first(:order => 'id DESC') + assert_equal "foo@example.org", user.mail + assert_equal "Ää", user.firstname + assert_equal "Öö", user.lastname + end + private def submit_email(filename, options={}) |