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:29 -0700 2008
commit  82778351a8b1036ac4bdc8e72a3f011151fefa31
tree    ac2d73e846d316cb7205a5c08f2039787f4ea643
parent  657898c821b3877ad25ee4f9764e169ce554e884
...
331
332
333
334
 
335
336
337
...
331
332
333
 
334
335
336
337
0
@@ -331,7 +331,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