1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-01-10 17:41:31 +00:00

Test that Redmine::MimeType.css_class_of, main_mimetype_of and is_type? are case-insensitive (#29359).

git-svn-id: http://svn.redmine.org/redmine/trunk@17472 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA 2018-08-15 13:20:45 +00:00
parent 371d84556f
commit bd08684e1d

View File

@ -36,6 +36,7 @@ class Redmine::MimeTypeTest < ActiveSupport::TestCase
def test_css_class_of
to_test = {'test.txt' => 'text-plain',
'test.c' => 'text-x-c',
'TEST.JPG' => 'image-jpeg',
}
to_test.each do |name, expected|
assert_equal expected, Redmine::MimeType.css_class_of(name)
@ -49,6 +50,7 @@ class Redmine::MimeTypeTest < ActiveSupport::TestCase
def test_main_mimetype_of
to_test = {'test.txt' => 'text',
'test.c' => 'text',
'TEST.JPG' => 'image',
}
to_test.each do |name, expected|
assert_equal expected, Redmine::MimeType.main_mimetype_of(name)
@ -63,6 +65,7 @@ class Redmine::MimeTypeTest < ActiveSupport::TestCase
to_test = {['text', 'test.unk'] => false,
['text', 'test.txt'] => true,
['text', 'test.c'] => true,
['image', 'TEST.JPG'] => true,
}
to_test.each do |args, expected|
assert_equal expected, Redmine::MimeType.is_type?(*args)