1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-31 12:49:38 +00:00

Test for r18057 (#30441).

Patch by Go MAEDA.


git-svn-id: http://svn.redmine.org/redmine/trunk@18058 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA 2019-04-12 05:42:31 +00:00
parent 51b0542e7d
commit 0d061d43e8

View File

@ -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 %(<img src="/attachments/download/#{attachment.id}/caf%C3%A9.jpg" alt="" />),
textilizable("!café.jpg!)", :attachments => [attachment])
to_test.each do |filename, result|
attachment = Attachment.generate!(:filename => filename)
assert_include %(<img src="/attachments/download/#{attachment.id}/#{result}" alt="" />), 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 %(<img src="/attachments/download/#{attachment.id}/caf%C3%A9.jpg" alt="" />),
textilizable("![](café.jpg)", :attachments => [attachment])
to_test.each do |filename, result|
attachment = Attachment.generate!(:filename => filename)
assert_include %(<img src="/attachments/download/#{attachment.id}/#{result}" alt="" />), textilizable("![](#{filename})", :attachments => [attachment])
end
end
end