X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/b47d1fbe36d5aeb9b79d6bbaab035ca448a3c3ef..99e1580f0d7707b8e2f8c08f8aae70c3d4906637:/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