From 0a5ef25e87f7896a70bfd86302e6e8995b518f98 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Mon, 22 Nov 2021 08:42:44 +0000 Subject: 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 --- test/helpers/application_helper_test.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/helpers') 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 "

#{result}

", 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?("\"\"") + assert textilizable(raw, :object => journal).include?("\"\"") + end + def test_attached_images_with_textile_and_non_ascii_filename to_test = { 'CAFÉ.JPG' => 'CAF%C3%89.JPG', -- cgit v1.2.3