summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-04-19 08:26:53 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-04-19 08:26:53 +0000
commit62eb536e32f92077f44a6d4b9e71260060b70659 (patch)
treeddea1e5241d1f3536952765da21dd310ebaabba8
parent67f90df175babcb4501daf7d97472c49db777588 (diff)
downloadredmine-62eb536e32f92077f44a6d4b9e71260060b70659.tar.gz
redmine-62eb536e32f92077f44a6d4b9e71260060b70659.zip
Additional test for MailHandler.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9448 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--test/unit/mail_handler_test.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/unit/mail_handler_test.rb b/test/unit/mail_handler_test.rb
index 73a93088d..532551834 100644
--- a/test/unit/mail_handler_test.rb
+++ b/test/unit/mail_handler_test.rb
@@ -347,6 +347,15 @@ class MailHandlerTest < ActiveSupport::TestCase
assert_equal 'caaf384198bcbc9563ab5c058acd73cd', attachment.digest
end
+ def test_should_ignore_emails_from_locked_users
+ User.find(2).lock!
+
+ MailHandler.any_instance.expects(:dispatch).never
+ assert_no_difference 'Issue.count' do
+ assert_equal false, submit_email('ticket_on_given_project.eml')
+ end
+ end
+
def test_should_ignore_emails_from_emission_address
Role.anonymous.add_permission!(:add_issues)
assert_no_difference 'User.count' do
@@ -360,6 +369,7 @@ class MailHandlerTest < ActiveSupport::TestCase
end
def test_should_ignore_auto_replied_emails
+ MailHandler.any_instance.expects(:dispatch).never
[
"X-Auto-Response-Suppress: OOF",
"Auto-Submitted: auto-replied",
@@ -367,7 +377,7 @@ class MailHandlerTest < ActiveSupport::TestCase
].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