X-Git-Url: https://projects.mako.cc/source/selectricity/blobdiff_plain/a38724bea6c09b479a93948b6ef4ef61edd24f39..e75d29998f5348be83dde4b6fd8f5aa437c2dc74:/vendor/plugins/attachment_fu/test/basic_test.rb diff --git a/vendor/plugins/attachment_fu/test/basic_test.rb b/vendor/plugins/attachment_fu/test/basic_test.rb index f8f881c..70a8bda 100644 --- a/vendor/plugins/attachment_fu/test/basic_test.rb +++ b/vendor/plugins/attachment_fu/test/basic_test.rb @@ -24,8 +24,8 @@ class BasicTest < Test::Unit::TestCase def test_should_normalize_content_types_to_array assert_equal %w(pdf), PdfAttachment.attachment_options[:content_type] assert_equal %w(pdf doc txt), DocAttachment.attachment_options[:content_type] - assert_equal ['image/jpeg', 'image/pjpeg', 'image/gif', 'image/png', 'image/x-png', 'image/jpg'], ImageAttachment.attachment_options[:content_type] - assert_equal ['pdf', 'image/jpeg', 'image/pjpeg', 'image/gif', 'image/png', 'image/x-png', 'image/jpg'], ImageOrPdfAttachment.attachment_options[:content_type] + assert_equal Technoweenie::AttachmentFu.content_types, ImageAttachment.attachment_options[:content_type] + assert_equal ['pdf'] + Technoweenie::AttachmentFu.content_types, ImageOrPdfAttachment.attachment_options[:content_type] end def test_should_sanitize_content_type @@ -42,6 +42,12 @@ class BasicTest < Test::Unit::TestCase @attachment.filename = 'f o!O-.bar' assert_equal 'f_o_O-.bar', @attachment.filename + + @attachment.filename = 'sheeps_says_bææ' + assert_equal 'sheeps_says_b__', @attachment.filename + + @attachment.filename = nil + assert_nil @attachment.filename end def test_should_convert_thumbnail_name @@ -61,4 +67,4 @@ class BasicTest < Test::Unit::TestCase klass.has_attachment :thumbnails => [] end end -end \ No newline at end of file +end