public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Add TestUploadFile.content_type= to match Request.UploadedFile

[#920 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
timhaines (author)
Wed Aug 27 17:57:25 -0700 2008
jeremy (committer)
Wed Aug 27 18:50:57 -0700 2008
commit  dabd8c82827c6547f3f1870d9d6f8a3e6c1a830d
tree    0c9cad277e8d4973c40cdc25fefdf750fda3b023
parent  4d71e99d1fc1f57900288e008d7528c339138cf0
...
333
334
335
336
 
337
338
339
...
333
334
335
 
336
337
338
339
0
@@ -333,7 +333,7 @@ module ActionController #:nodoc:
0
     attr_reader :original_filename
0
 
0
     # The content type of the "uploaded" file
0
-    attr_reader :content_type
0
+    attr_accessor :content_type
0
 
0
     def initialize(path, content_type = Mime::TEXT, binary = false)
0
       raise "#{path} file does not exist" unless File.exist?(path)
...
531
532
533
 
 
 
 
 
534
535
536
...
531
532
533
534
535
536
537
538
539
540
541
0
@@ -531,6 +531,11 @@ XML
0
     assert_equal content_type, file.content_type
0
     assert_equal file.path, file.local_path
0
     assert_equal expected, file.read
0
+
0
+    new_content_type = "new content_type"
0
+    file.content_type = new_content_type
0
+    assert_equal new_content_type, file.content_type
0
+
0
   end
0
   
0
   def test_test_uploaded_file_with_binary

Comments