summaryrefslogtreecommitdiffstats
path: root/test/helpers
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2021-11-22 08:42:44 +0000
committerGo MAEDA <maeda@farend.jp>2021-11-22 08:42:44 +0000
commit0a5ef25e87f7896a70bfd86302e6e8995b518f98 (patch)
tree95264ef633eb0c0505c46bbfe68f886dd7d4e5a3 /test/helpers
parentd72ae9b32b7bef20eb1f2f291d54f3ad4297994e (diff)
downloadredmine-0a5ef25e87f7896a70bfd86302e6e8995b518f98.tar.gz
redmine-0a5ef25e87f7896a70bfd86302e6e8995b518f98.zip
Download all attachments in a journal (#35462).
Patch by Takenori TAKAKI. git-svn-id: http://svn.redmine.org/redmine/trunk@21292 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/helpers')
-rw-r--r--test/helpers/application_helper_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/helpers/application_helper_test.rb b/test/helpers/application_helper_test.rb
index 108b0dfae..6e79dce2e 100644
--- a/test/helpers/application_helper_test.rb
+++ b/test/helpers/application_helper_test.rb
@@ -184,6 +184,22 @@ class ApplicationHelperTest < Redmine::HelperTest
to_test.each {|text, result| assert_equal "<p>#{result}</p>", textilizable(text, :attachments => attachments)}
end
+ def test_attached_images_on_issue
+ issue = Issue.generate!
+ attachment_1 = Attachment.generate!(:file => mock_file_with_options(:original_filename => "attached_on_issue.png"), :container => issue)
+ journal = issue.init_journal(User.find(2), issue)
+ attachment_2 = Attachment.generate!(:file => mock_file_with_options(:original_filename => "attached_on_journal.png"), :container => issue)
+ journal.journalize_attachment(attachment_2, :added)
+
+ raw = <<~RAW
+ !attached_on_issue.png!
+ !attached_on_journal.png!'
+ RAW
+
+ assert textilizable(raw, :object => journal).include?("<img src=\"/attachments/download/#{attachment_1.id}/attached_on_issue.png\" alt=\"\" />")
+ assert textilizable(raw, :object => journal).include?("<img src=\"/attachments/download/#{attachment_2.id}/attached_on_journal.png\" alt=\"\" />")
+ end
+
def test_attached_images_with_textile_and_non_ascii_filename
to_test = {
'CAFÉ.JPG' => 'CAF%C3%89.JPG',