Skip to content
Browse files

Add TestUploadFile.content_type= to match Request.UploadedFile

[#920 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information...
1 parent 657898c commit 82778351a8b1036ac4bdc8e72a3f011151fefa31 @timhaines timhaines committed with jeremy Aug 28, 2008
Showing with 6 additions and 1 deletion.
  1. +1 −1 actionpack/lib/action_controller/test_process.rb
  2. +5 −0 actionpack/test/controller/test_test.rb
View
2 actionpack/lib/action_controller/test_process.rb
@@ -331,7 +331,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)
View
5 actionpack/test/controller/test_test.rb
@@ -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

0 comments on commit 8277835

Please sign in to comment.
Something went wrong with that request. Please try again.