mirror of
https://github.com/redmine/redmine.git
synced 2025-11-02 03:15:57 +01:00
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
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user