diff options
author | Go MAEDA <maeda@farend.jp> | 2021-03-20 23:29:21 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2021-03-20 23:29:21 +0000 |
commit | 7337343f569599c4f1250b22312e093685027568 (patch) | |
tree | 01ffec4a05929ecf8439697c54edaf39e2ad680f /test/unit/attachment_test.rb | |
parent | c1b5489a860cbcaa5d031e08f45d16b8be89a953 (diff) | |
download | redmine-7337343f569599c4f1250b22312e093685027568.tar.gz redmine-7337343f569599c4f1250b22312e093685027568.zip |
Case-insensitive matching fails for Unicode filenames when referring to attachments in text formatting (#27780).
Patch by Go MAEDA.
git-svn-id: http://svn.redmine.org/redmine/trunk@20835 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/attachment_test.rb')
-rw-r--r-- | test/unit/attachment_test.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/unit/attachment_test.rb b/test/unit/attachment_test.rb index 868e83f48..21b5ab431 100644 --- a/test/unit/attachment_test.rb +++ b/test/unit/attachment_test.rb @@ -473,6 +473,19 @@ class AttachmentTest < ActiveSupport::TestCase Attachment.latest_attach(Attachment.limit(2).to_a, string) end + def test_latest_attach_should_support_unicode_case_folding + a_capital = Attachment.create!( + :author => User.find(1), + :file => mock_file(:filename => 'Ā.TXT') + ) + a_small = Attachment.create!( + :author => User.find(1), + :file => mock_file(:filename => 'ā.txt') + ) + + assert_equal(a_small, Attachment.latest_attach([a_capital, a_small], 'Ā.TXT')) + end + def test_thumbnailable_should_be_true_for_images skip unless convert_installed? assert_equal true, Attachment.new(:filename => 'test.jpg').thumbnailable? |