diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-11-18 23:09:45 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-11-18 23:09:45 +0000 |
commit | a829bfa75578e7025272de9371e81192ab651fa7 (patch) | |
tree | 6c68e0b3018c69ea3b99cf094ce1ec005f9f3c18 /test | |
parent | f232f56d97408a8677ee505081d2852d32f12a31 (diff) | |
download | redmine-a829bfa75578e7025272de9371e81192ab651fa7.tar.gz redmine-a829bfa75578e7025272de9371e81192ab651fa7.zip |
Fixed that MailHandler raises an error when email has no subject header (#12396).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10850 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/fixtures/mail_handler/no_subject_header.eml | 10 | ||||
-rw-r--r-- | test/unit/mail_handler_test.rb | 9 |
2 files changed, 19 insertions, 0 deletions
diff --git a/test/fixtures/mail_handler/no_subject_header.eml b/test/fixtures/mail_handler/no_subject_header.eml new file mode 100644 index 000000000..e6538cbb9 --- /dev/null +++ b/test/fixtures/mail_handler/no_subject_header.eml @@ -0,0 +1,10 @@ +Content-Type: application/ms-tnef; name="winmail.dat" +Content-Transfer-Encoding: binary +From: John Smith <JSmith@somenet.foo> +To: "redmine@somenet.foo" <redmine@somenet.foo> +Date: Fri, 1 Jun 2012 14:39:38 +0200 +Message-ID: <87C31D42249DD0489D1A1444E3232DD7019D6183@foo.bar> +Accept-Language: de-CH, en-US +Content-Language: de-CH + +Fixture diff --git a/test/unit/mail_handler_test.rb b/test/unit/mail_handler_test.rb index ab208196b..3a184b201 100644 --- a/test/unit/mail_handler_test.rb +++ b/test/unit/mail_handler_test.rb @@ -395,6 +395,15 @@ class MailHandlerTest < ActiveSupport::TestCase assert_equal ja, issue.subject end + def test_add_issue_with_no_subject_header + issue = submit_email( + 'no_subject_header.eml', + :issue => {:project => 'ecookbook'} + ) + assert_kind_of Issue, issue + assert_equal '(no subject)', issue.subject + end + def test_add_issue_with_mixed_japanese_subject issue = submit_email( 'subject_japanese_2.eml', |