Browse files

adding tests for uploaded file

  • Loading branch information...
1 parent 9eeb24c commit 1e50fae2590b5df0b053e121b48565e7e472f4e7 @tenderlove tenderlove committed Oct 4, 2010
Showing with 25 additions and 0 deletions.
  1. +25 −0 actionpack/test/dispatch/uploaded_file_test.rb
View
25 actionpack/test/dispatch/uploaded_file_test.rb
@@ -0,0 +1,25 @@
+require 'abstract_unit'
+
+module ActionDispatch
+ class UploadedFileTest < ActiveSupport::TestCase
+ def test_original_filename
+ uf = Http::UploadedFile.new(:filename => 'foo')
+ assert_equal 'foo', uf.original_filename
+ end
+
+ def test_content_type
+ uf = Http::UploadedFile.new(:type => 'foo')
+ assert_equal 'foo', uf.content_type
+ end
+
+ def test_headers
+ uf = Http::UploadedFile.new(:head => 'foo')
+ assert_equal 'foo', uf.headers
+ end
+
+ def test_tempfile
+ uf = Http::UploadedFile.new(:tempfile => 'foo')
+ assert_equal 'foo', uf.tempfile
+ end
+ end
+end

0 comments on commit 1e50fae

Please sign in to comment.