]> projects.mako.cc - selectricity/blobdiff - vendor/plugins/attachment_fu/test/extra_attachment_test.rb
fix security issue
[selectricity] / vendor / plugins / attachment_fu / test / extra_attachment_test.rb
index 15b185209b27794d9a2e7430cd1a1984a7eac3cf..6c58554175934d1413dd09019f3c1027e81416dc 100644 (file)
@@ -24,6 +24,16 @@ class OrphanAttachmentTest < Test::Unit::TestCase
     end
   end
   
+  def test_should_create_file_from_merb_temp_file
+    assert_created do
+      attachment = upload_merb_file :filename => '/files/foo.txt'
+      assert_valid attachment
+      assert !attachment.db_file.new_record? if attachment.respond_to?(:db_file)
+      assert  attachment.image?
+      assert !attachment.size.zero?
+    end
+  end
+  
   def test_should_create_image_from_uploaded_file_with_custom_content_type
     assert_created do
       attachment = upload_file :content_type => 'foo/bar', :filename => '/files/rails.png'

Benjamin Mako Hill || Want to submit a patch?