summaryrefslogtreecommitdiffstats
path: root/test/unit/mail_handler_test.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-06-03 16:17:03 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-06-03 16:17:03 +0000
commit6b1fe6a2b44f7ff7aee47693b45a544770e7b4a0 (patch)
treee6f554a8072fc31935ec3ab812bad90c3451a5a1 /test/unit/mail_handler_test.rb
parente2a8c53938dfcb7159b6c5feabc78f1d355c1453 (diff)
downloadredmine-6b1fe6a2b44f7ff7aee47693b45a544770e7b4a0.tar.gz
redmine-6b1fe6a2b44f7ff7aee47693b45a544770e7b4a0.zip
add S/MIME signature mail test (#31593)
git-svn-id: http://svn.redmine.org/redmine/trunk@19808 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/mail_handler_test.rb')
-rw-r--r--test/unit/mail_handler_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/unit/mail_handler_test.rb b/test/unit/mail_handler_test.rb
index 630bf5fc7..489106379 100644
--- a/test/unit/mail_handler_test.rb
+++ b/test/unit/mail_handler_test.rb
@@ -1282,6 +1282,22 @@ class MailHandlerTest < ActiveSupport::TestCase
assert_equal false, MailHandler.safe_receive
end
+ def test_smine_signature
+ issue = submit_email('smime_signature.eml', :issue => {:project => 'onlinestore'})
+ assert issue.is_a?(Issue)
+ assert !issue.new_record?
+ issue.reload
+ assert_equal 'Self-Signed S/MIME signature', issue.subject
+ assert_equal User.find_by_login('jsmith'), issue.author
+ assert_equal Project.find(2), issue.project
+ assert_equal 'smime.sh.txt describes how to create Self-Signed S/MIME Certs.', issue.description
+ assert_equal 2, issue.attachments.size
+ assert_equal 'smime.sh.txt', issue.attachments[0].filename
+ assert_equal 'text/plain', issue.attachments[0].content_type
+ assert_equal 'smime.p7s', issue.attachments[1].filename
+ assert_equal 'application/x-pkcs7-signature', issue.attachments[1].content_type
+ end
+
private
def submit_email(filename, options={})