"attachment:filename" should generate a link to preview instead of download (#26310, #25988).

git-svn-id: http://svn.redmine.org/redmine/trunk@16738 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2017-07-02 09:54:24 +00:00
parent c15eaf46db
commit c7e32aa202
2 changed files with 3 additions and 3 deletions

View File

@@ -667,7 +667,7 @@ RAW
def test_attachment_links
text = 'attachment:error281.txt'
result = link_to("error281.txt", "/attachments/download/1/error281.txt",
result = link_to("error281.txt", "/attachments/1/error281.txt",
:class => "attachment")
assert_equal "<p>#{result}</p>",
textilizable(text,
@@ -679,7 +679,7 @@ RAW
set_tmp_attachments_directory
a1 = Attachment.generate!(:filename => "test.txt", :created_on => 1.hour.ago)
a2 = Attachment.generate!(:filename => "test.txt")
result = link_to("test.txt", "/attachments/download/#{a2.id}/test.txt",
result = link_to("test.txt", "/attachments/#{a2.id}/test.txt",
:class => "attachment")
assert_equal "<p>#{result}</p>",
textilizable('attachment:test.txt', :attachments => [a1, a2])