From b69da86ea545b342036fb37a472ec5abefaf3bd5 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Sat, 25 Apr 2009 13:56:37 -0500 Subject: Remove vendored version of Rack --- actionpack/test/dispatch/request/multipart_params_parsing_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/test/dispatch/request/multipart_params_parsing_test.rb') diff --git a/actionpack/test/dispatch/request/multipart_params_parsing_test.rb b/actionpack/test/dispatch/request/multipart_params_parsing_test.rb index 88b81dc493..6322cfc84a 100644 --- a/actionpack/test/dispatch/request/multipart_params_parsing_test.rb +++ b/actionpack/test/dispatch/request/multipart_params_parsing_test.rb @@ -96,7 +96,7 @@ class MultipartParamsParsingTest < ActionController::IntegrationTest # Ruby CGI doesn't handle multipart/mixed for us. files = params['files'] - assert_kind_of String, files + assert_kind_of Tempfile, files files.force_encoding('ASCII-8BIT') if files.respond_to?(:force_encoding) assert_equal 19756, files.size end -- cgit v1.2.3 From 4f412a10b6125831af34d874927f891f586d0101 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Sat, 25 Apr 2009 14:04:03 -0500 Subject: Remove RewindableInput middleware since all input MUST be rewindable according to a recent change in the Rack 1.0 SPEC --- .../request/multipart_params_parsing_test.rb | 61 ---------------------- 1 file changed, 61 deletions(-) (limited to 'actionpack/test/dispatch/request/multipart_params_parsing_test.rb') diff --git a/actionpack/test/dispatch/request/multipart_params_parsing_test.rb b/actionpack/test/dispatch/request/multipart_params_parsing_test.rb index 6322cfc84a..cc81a87cb9 100644 --- a/actionpack/test/dispatch/request/multipart_params_parsing_test.rb +++ b/actionpack/test/dispatch/request/multipart_params_parsing_test.rb @@ -133,46 +133,6 @@ class MultipartParamsParsingTest < ActionController::IntegrationTest end end - # The lint wrapper is used in integration tests - # instead of a normal StringIO class - InputWrapper = Rack::Lint::InputWrapper - - test "parses unwindable stream" do - InputWrapper.any_instance.stubs(:rewind).raises(Errno::ESPIPE) - params = parse_multipart('large_text_file') - assert_equal %w(file foo), params.keys.sort - assert_equal 'bar', params['foo'] - end - - test "uploads and reads file with unwindable input" do - InputWrapper.any_instance.stubs(:rewind).raises(Errno::ESPIPE) - - with_test_routing do - post '/read', :uploaded_data => fixture_file_upload(FIXTURE_PATH + "/hello.txt", "text/plain") - assert_equal "File: Hello", response.body - end - end - - test "passes through rack middleware and uploads file" do - with_muck_middleware do - with_test_routing do - post '/read', :uploaded_data => fixture_file_upload(FIXTURE_PATH + "/hello.txt", "text/plain") - assert_equal "File: Hello", response.body - end - end - end - - test "passes through rack middleware and uploads file with unwindable input" do - InputWrapper.any_instance.stubs(:rewind).raises(Errno::ESPIPE) - - with_muck_middleware do - with_test_routing do - post '/read', :uploaded_data => fixture_file_upload(FIXTURE_PATH + "/hello.txt", "text/plain") - assert_equal "File: Hello", response.body - end - end - end - private def fixture(name) File.open(File.join(FIXTURE_PATH, name), 'rb') do |file| @@ -199,25 +159,4 @@ class MultipartParamsParsingTest < ActionController::IntegrationTest yield end end - - class MuckMiddleware - def initialize(app) - @app = app - end - - def call(env) - env['rack.input'].read - env['rack.input'].rewind - @app.call(env) - end - end - - def with_muck_middleware - original_middleware = ActionController::Dispatcher.middleware - middleware = original_middleware.dup - middleware.insert_after ActionDispatch::RewindableInput, MuckMiddleware - ActionController::Dispatcher.middleware = middleware - yield - ActionController::Dispatcher.middleware = original_middleware - end end -- cgit v1.2.3 From c2b4da1c425dd8e1cc6606d49aea53e4f7521b91 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Mon, 27 Apr 2009 00:17:02 -0700 Subject: Sufficient to test that multipart/mixed wasn't parsed to a hash --- actionpack/test/dispatch/request/multipart_params_parsing_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/test/dispatch/request/multipart_params_parsing_test.rb') diff --git a/actionpack/test/dispatch/request/multipart_params_parsing_test.rb b/actionpack/test/dispatch/request/multipart_params_parsing_test.rb index cc81a87cb9..aaf647e45a 100644 --- a/actionpack/test/dispatch/request/multipart_params_parsing_test.rb +++ b/actionpack/test/dispatch/request/multipart_params_parsing_test.rb @@ -96,7 +96,7 @@ class MultipartParamsParsingTest < ActionController::IntegrationTest # Ruby CGI doesn't handle multipart/mixed for us. files = params['files'] - assert_kind_of Tempfile, files + assert_not_kind_of Hash, files files.force_encoding('ASCII-8BIT') if files.respond_to?(:force_encoding) assert_equal 19756, files.size end -- cgit v1.2.3 From dde063507ac40fda1a67f06a54c1a57d237f57b2 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Mon, 27 Apr 2009 09:29:01 -0700 Subject: Can't please them all --- actionpack/test/dispatch/request/multipart_params_parsing_test.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'actionpack/test/dispatch/request/multipart_params_parsing_test.rb') diff --git a/actionpack/test/dispatch/request/multipart_params_parsing_test.rb b/actionpack/test/dispatch/request/multipart_params_parsing_test.rb index aaf647e45a..9e008a9ae8 100644 --- a/actionpack/test/dispatch/request/multipart_params_parsing_test.rb +++ b/actionpack/test/dispatch/request/multipart_params_parsing_test.rb @@ -94,9 +94,8 @@ class MultipartParamsParsingTest < ActionController::IntegrationTest assert_equal %w(files foo), params.keys.sort assert_equal 'bar', params['foo'] - # Ruby CGI doesn't handle multipart/mixed for us. + # Rack doesn't handle multipart/mixed for us. files = params['files'] - assert_not_kind_of Hash, files files.force_encoding('ASCII-8BIT') if files.respond_to?(:force_encoding) assert_equal 19756, files.size end -- cgit v1.2.3