diff options
author | Bryan Ash <bryan.a.ash@gmail.com> | 2009-01-13 14:42:43 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-01-13 14:42:43 -0600 |
commit | 5a43908c7414996354ca427354d98d789e0210e7 (patch) | |
tree | b198bd8b488d2da4e63e2b245056ddd5c15c5c3f /actionpack/test | |
parent | d3107ce3b04a14bd5674da6812acbff30aedaf73 (diff) | |
download | rails-5a43908c7414996354ca427354d98d789e0210e7.tar.gz rails-5a43908c7414996354ca427354d98d789e0210e7.tar.bz2 rails-5a43908c7414996354ca427354d98d789e0210e7.zip |
Explicitly read as binary in multipart_body for Windows [#1065 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/request/multipart_params_parsing_test.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/actionpack/test/controller/request/multipart_params_parsing_test.rb b/actionpack/test/controller/request/multipart_params_parsing_test.rb index 03ab164972..ce28ff46fe 100644 --- a/actionpack/test/controller/request/multipart_params_parsing_test.rb +++ b/actionpack/test/controller/request/multipart_params_parsing_test.rb @@ -3,11 +3,10 @@ require 'abstract_unit' class MultipartParamsParsingTest < ActionController::IntegrationTest class TestController < ActionController::Base class << self - attr_accessor :last_request_parameters, :last_request_type + attr_accessor :last_request_parameters end def parse - self.class.last_request_type = ActionController::Base.param_parsers[request.content_type] self.class.last_request_parameters = request.request_parameters head :ok end @@ -21,7 +20,6 @@ class MultipartParamsParsingTest < ActionController::IntegrationTest def teardown TestController.last_request_parameters = nil - TestController.last_request_type = nil end test "parses single parameter" do @@ -103,11 +101,13 @@ class MultipartParamsParsingTest < ActionController::IntegrationTest assert_equal 19756, files.size end - test "uploads and parses parameters" do + test "uploads and reads binary file" do with_test_routing do - params = { :uploaded_data => fixture_file_upload(FIXTURE_PATH + "/mona_lisa.jpg", "image/jpg") } - post '/parse', params, :location => 'blah' - assert_equal(:multipart_form, TestController.last_request_type) + fixture = FIXTURE_PATH + "/mona_lisa.jpg" + params = { :uploaded_data => fixture_file_upload(fixture, "image/jpg") } + post '/read', params + expected_length = 'File: '.length + File.size(fixture) + assert_equal expected_length, response.content_length end end |