Permalink
Browse files

Add TestUploadFile.content_type= to match Request.UploadedFile

[#920 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information...
timhaines authored and jeremy committed Aug 28, 2008
1 parent 4d71e99 commit dabd8c82827c6547f3f1870d9d6f8a3e6c1a830d
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
@@ -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)
@@ -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 dabd8c8

Please sign in to comment.