From 0d061d43e8a64d7ebec0597c3031cb984353c34b Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Fri, 12 Apr 2019 05:42:31 +0000 Subject: Test for r18057 (#30441). Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@18058 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/helpers/application_helper_test.rb | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'test/helpers') diff --git a/test/helpers/application_helper_test.rb b/test/helpers/application_helper_test.rb index a524c91b8..74acae4b0 100644 --- a/test/helpers/application_helper_test.rb +++ b/test/helpers/application_helper_test.rb @@ -156,20 +156,30 @@ RAW end def test_attached_images_with_textile_and_non_ascii_filename - attachment = Attachment.generate!(:filename => 'café.jpg') + to_test = { + 'CAFÉ.JPG' => 'CAF%C3%89.JPG', + 'crème.jpg' => 'cr%C3%A8me.jpg', + } with_settings :text_formatting => 'textile' do - assert_include %(), - textilizable("!café.jpg!)", :attachments => [attachment]) + to_test.each do |filename, result| + attachment = Attachment.generate!(:filename => filename) + assert_include %(), textilizable("!#{filename}!", :attachments => [attachment]) + end end end def test_attached_images_with_markdown_and_non_ascii_filename skip unless Object.const_defined?(:Redcarpet) - attachment = Attachment.generate!(:filename => 'café.jpg') + to_test = { + 'CAFÉ.JPG' => 'CAF%C3%89.JPG', + 'crème.jpg' => 'cr%C3%A8me.jpg', + } with_settings :text_formatting => 'markdown' do - assert_include %(), - textilizable("![](café.jpg)", :attachments => [attachment]) + to_test.each do |filename, result| + attachment = Attachment.generate!(:filename => filename) + assert_include %(), textilizable("![](#{filename})", :attachments => [attachment]) + end end end -- cgit v1.2.3