]> source.dussan.org Git - redmine.git/commitdiff
mail_body method in test/test_helper.rb raises an exception if the message is not...
authorGo MAEDA <maeda@farend.jp>
Fri, 13 Sep 2019 08:51:46 +0000 (08:51 +0000)
committerGo MAEDA <maeda@farend.jp>
Fri, 13 Sep 2019 08:51:46 +0000 (08:51 +0000)
This change fixes random test failures.

git-svn-id: http://svn.redmine.org/redmine/trunk@18465 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/test_helper.rb

index 390ea92b48ae687d8a01a739e7ce3ee628cd7164..6a6fd7fa51103d4f9db7ea78665ac1d82a15720c 100644 (file)
@@ -250,7 +250,7 @@ class ActiveSupport::TestCase
   end
 
   def mail_body(mail)
-    mail.parts.first.body.encoded
+    (mail.multipart? ? mail.parts.first : mail).body.encoded
   end
 
   # Returns the lft value for a new root issue