Permalink
Browse files

Correctly identify attachments with uppercase extensions

  • Loading branch information...
1 parent 7508a49 commit 8e8d1939b646ad6d8fbd44c4247c6a834c733e88 @tomstuart tomstuart committed Feb 2, 2012
Showing with 2 additions and 1 deletion.
  1. +1 −1 app/helpers/admin/documents_helper.rb
  2. +1 −0 test/unit/helpers/admin/documents_helper_test.rb
@@ -41,7 +41,7 @@ def filter_class(options)
}
def humanized_content_type(file_extension)
- FILE_EXTENSION_VS_HUMANIZED_CONTENT_TYPE[file_extension]
+ FILE_EXTENSION_VS_HUMANIZED_CONTENT_TYPE[file_extension.downcase] if file_extension.present?
end
def order_link(document)
@@ -7,6 +7,7 @@ class Admin::DocumentsHelperTest < ActionView::TestCase
test "should return PDF Document for humanized content type" do
assert_equal "PDF Document", humanized_content_type("pdf")
+ assert_equal "PDF Document", humanized_content_type("PDF")
end
test "should return CSV Document for humanized content type" do

0 comments on commit 8e8d193

Please sign in to comment.