Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add TestUploadFile.content_type= to match Request.UploadedFile

[#920 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information...
commit dabd8c82827c6547f3f1870d9d6f8a3e6c1a830d 1 parent 4d71e99
Tim Haines timhaines authored jeremy committed
2  actionpack/lib/action_controller/test_process.rb
View
@@ -333,7 +333,7 @@ class TestUploadedFile
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)
5 actionpack/test/controller/test_test.rb
View
@@ -531,6 +531,11 @@ def test_test_uploaded_file
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
Please sign in to comment.
Something went wrong with that request. Please try again.