aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/uploaded_file_test.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-10-04 17:08:25 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-10-04 17:08:25 -0700
commit8a9747021085c569f0118db1093bc12cfa2ba915 (patch)
tree8de97e3ed2a14c8af4e1ddfc1178272c1a6bfae3 /actionpack/test/dispatch/uploaded_file_test.rb
parent876acf001a32887679e259f83a2fbad750ac2e67 (diff)
downloadrails-8a9747021085c569f0118db1093bc12cfa2ba915.tar.gz
rails-8a9747021085c569f0118db1093bc12cfa2ba915.tar.bz2
rails-8a9747021085c569f0118db1093bc12cfa2ba915.zip
raising an argument error if tempfile is not provided
Diffstat (limited to 'actionpack/test/dispatch/uploaded_file_test.rb')
-rw-r--r--actionpack/test/dispatch/uploaded_file_test.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/actionpack/test/dispatch/uploaded_file_test.rb b/actionpack/test/dispatch/uploaded_file_test.rb
index d04d5a8650..4173ce0a44 100644
--- a/actionpack/test/dispatch/uploaded_file_test.rb
+++ b/actionpack/test/dispatch/uploaded_file_test.rb
@@ -2,18 +2,24 @@ require 'abstract_unit'
module ActionDispatch
class UploadedFileTest < ActiveSupport::TestCase
+ def test_constructor_with_argument_error
+ assert_raises(ArgumentError) do
+ Http::UploadedFile.new({})
+ end
+ end
+
def test_original_filename
- uf = Http::UploadedFile.new(:filename => 'foo')
+ uf = Http::UploadedFile.new(:filename => 'foo', :tempfile => Object.new)
assert_equal 'foo', uf.original_filename
end
def test_content_type
- uf = Http::UploadedFile.new(:type => 'foo')
+ uf = Http::UploadedFile.new(:type => 'foo', :tempfile => Object.new)
assert_equal 'foo', uf.content_type
end
def test_headers
- uf = Http::UploadedFile.new(:head => 'foo')
+ uf = Http::UploadedFile.new(:head => 'foo', :tempfile => Object.new)
assert_equal 'foo', uf.headers
end