summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-03-14 08:39:24 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-03-14 08:39:24 +0000
commit5da48d929367df231df8dde382bdb8e5eb7e1540 (patch)
tree6fe5705960a449ebe6993ad15631ed5689869ed5 /test
parent1aea5ccfd4e818a93f6340b01fd659409f8ec598 (diff)
downloadredmine-5da48d929367df231df8dde382bdb8e5eb7e1540.tar.gz
redmine-5da48d929367df231df8dde382bdb8e5eb7e1540.zip
Attached inline images with non-ascii file name can not be seen when text formatting is Makdown (#19313).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@14080 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/helpers/application_helper_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb
index 13a34064f..a4c588676 100644
--- a/test/unit/helpers/application_helper_test.rb
+++ b/test/unit/helpers/application_helper_test.rb
@@ -151,6 +151,22 @@ RAW
to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text, :attachments => attachments) }
end
+ def test_attached_images_with_textile_and_non_ascii_filename
+ attachment = Attachment.generate!(:filename => 'café.jpg')
+ with_settings :text_formatting => 'textile' do
+ assert_include %(<img src="/attachments/download/#{attachment.id}/caf%C3%A9.jpg" alt="" />),
+ textilizable("!café.jpg!)", :attachments => [attachment])
+ end
+ end
+
+ def test_attached_images_with_markdown_and_non_ascii_filename
+ attachment = Attachment.generate!(:filename => 'café.jpg')
+ with_settings :text_formatting => 'markdown' do
+ assert_include %(<img src="/attachments/download/#{attachment.id}/caf%C3%A9.jpg" alt="">),
+ textilizable("![](café.jpg)", :attachments => [attachment])
+ end
+ end
+
def test_attached_images_filename_extension
set_tmp_attachments_directory
a1 = Attachment.new(