summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-04-13 16:55:04 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-04-13 16:55:04 +0000
commit4edc30d157b06be04b51474ab23be9dd3855b56e (patch)
tree77ada579f4d326b633927973b0cf42f081b5598b /test
parentdd8d8e0560d9bef18da084cd299be4b246f6ed61 (diff)
downloadredmine-4edc30d157b06be04b51474ab23be9dd3855b56e.tar.gz
redmine-4edc30d157b06be04b51474ab23be9dd3855b56e.zip
Ignore emails with Auto-Submitted: auto-replied header (#10607).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9390 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/mail_handler_test.rb18
1 files changed, 12 insertions, 6 deletions
diff --git a/test/unit/mail_handler_test.rb b/test/unit/mail_handler_test.rb
index 645a6f15f..73a93088d 100644
--- a/test/unit/mail_handler_test.rb
+++ b/test/unit/mail_handler_test.rb
@@ -359,12 +359,18 @@ class MailHandlerTest < ActiveSupport::TestCase
end
end
- def test_should_ignore_oof_emails
- raw = IO.read(File.join(FIXTURES_PATH, 'ticket_on_given_project.eml'))
- raw = "X-Auto-Response-Suppress: OOF\n" + raw
-
- assert_no_difference 'Issue.count' do
- assert_equal false, MailHandler.receive(raw)
+ def test_should_ignore_auto_replied_emails
+ [
+ "X-Auto-Response-Suppress: OOF",
+ "Auto-Submitted: auto-replied",
+ "Auto-Submitted: Auto-Replied"
+ ].each do |header|
+ raw = IO.read(File.join(FIXTURES_PATH, 'ticket_on_given_project.eml'))
+ raw = header + "\n" + raw
+
+ assert_no_difference 'Issue.count' do
+ assert_equal false, MailHandler.receive(raw), "email with #{header} header was not ignored"
+ end
end
end