Add TestUploadFile.content_type= to match Request.UploadedFile

[#920 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
This commit is contained in:
Tim Haines
2008-08-28 12:57:25 +12:00
committed by Jeremy Kemper
parent 657898c821
commit 82778351a8
2 changed files with 6 additions and 1 deletions

View File

@@ -331,7 +331,7 @@ module ActionController #:nodoc:
attr_reader :original_filename
# The content type of the "uploaded" file
attr_reader :content_type
attr_accessor :content_type
def initialize(path, content_type = Mime::TEXT, binary = false)
raise "#{path} file does not exist" unless File.exist?(path)

View File

@@ -531,6 +531,11 @@ XML
assert_equal content_type, file.content_type
assert_equal file.path, file.local_path
assert_equal expected, file.read
new_content_type = "new content_type"
file.content_type = new_content_type
assert_equal new_content_type, file.content_type
end
def test_test_uploaded_file_with_binary