From 12b37ae754b76bdf88f9a3ac134f7072c6987bf9 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Mon, 9 Jul 2018 14:29:38 +0000 Subject: Remove filename from attachment preview links (#27822). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch by Felix Schäfer and Gregor Schmidt. git-svn-id: http://svn.redmine.org/redmine/trunk@17440 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/helpers/application_helper_test.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'test/helpers') diff --git a/test/helpers/application_helper_test.rb b/test/helpers/application_helper_test.rb index e28a56797..aa403be46 100644 --- a/test/helpers/application_helper_test.rb +++ b/test/helpers/application_helper_test.rb @@ -677,7 +677,7 @@ RAW def test_attachment_links text = 'attachment:error281.txt' - result = link_to("error281.txt", "/attachments/1/error281.txt", + result = link_to("error281.txt", "/attachments/1", :class => "attachment") assert_equal "

#{result}

", textilizable(text, @@ -689,7 +689,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/#{a2.id}/test.txt", + result = link_to("test.txt", "/attachments/#{a2.id}", :class => "attachment") assert_equal "

#{result}

", textilizable('attachment:test.txt', :attachments => [a1, a2]) @@ -700,13 +700,13 @@ RAW with_settings :text_formatting => 'textile' do raw = "attachment:image@2x.png should not be parsed in image@2x.png" - assert_match %r{

image@2x.png should not be parsed in image@2x.png

}, + assert_match %r{

image@2x.png should not be parsed in image@2x.png

}, textilizable(raw, :attachments => [attachment]) end with_settings :text_formatting => 'markdown' do raw = "attachment:image@2x.png should not be parsed in image@2x.png" - assert_match %r{

image@2x.png should not be parsed in image@2x.png

} , + assert_match %r{

image@2x.png should not be parsed in image@2x.png

} , textilizable(raw, :attachments => [attachment]) end end @@ -1445,16 +1445,16 @@ RAW def test_link_to_attachment a = Attachment.find(3) - assert_equal 'logo.gif', + assert_equal 'logo.gif', link_to_attachment(a) - assert_equal 'Text', + assert_equal 'Text', link_to_attachment(a, :text => 'Text') - result = link_to("logo.gif", "/attachments/3/logo.gif", :class => "foo") + result = link_to("logo.gif", "/attachments/3", :class => "foo") assert_equal result, link_to_attachment(a, :class => 'foo') assert_equal 'logo.gif', link_to_attachment(a, :download => true) - assert_equal 'logo.gif', + assert_equal 'logo.gif', link_to_attachment(a, :only_path => false) end @@ -1462,7 +1462,7 @@ RAW a = Attachment.find(3) assert_select_in thumbnail_tag(a), 'a[href=?][title=?] img[src=?]', - "/attachments/3/logo.gif", "logo.gif", "/attachments/thumbnail/3" + "/attachments/3", "logo.gif", "/attachments/thumbnail/3" end def test_link_to_project -- cgit v1.2.3