mirror of
https://github.com/github/rails.git
synced 2026-04-04 03:00:58 -04:00
Add TestUploadFile.content_type= to match Request.UploadedFile
[#920 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
This commit is contained in:
committed by
Jeremy Kemper
parent
657898c821
commit
82778351a8
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user