From f73e1c2ec0711782870b7935da84b40596ad3577 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Tue, 15 May 2007 22:10:03 +0000 Subject: Move request parameter parsing from CGI to AbstractRequest. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6742 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/controller/cgi_test.rb | 35 +--------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) (limited to 'actionpack/test/controller/cgi_test.rb') diff --git a/actionpack/test/controller/cgi_test.rb b/actionpack/test/controller/cgi_test.rb index 877423a0d1..b8535548b7 100755 --- a/actionpack/test/controller/cgi_test.rb +++ b/actionpack/test/controller/cgi_test.rb @@ -274,35 +274,6 @@ class CGITest < Test::Unit::TestCase end -class XmlCGITest < Test::Unit::TestCase - def test_single_file - raw_post_data = - "David#{Base64.encode64('ABC')}" - person = CGI.parse_formatted_request_parameters(Mime::XML, raw_post_data) - assert_equal "image/jpg", person['person']['avatar'].content_type - assert_equal "me.jpg", person['person']['avatar'].original_filename - assert_equal "ABC", person['person']['avatar'].read - end - - def test_multiple_files - raw_post_data = - "David" + - "#{Base64.encode64('ABC')}" + - "#{Base64.encode64('DEF')}" + - "" - person = CGI.parse_formatted_request_parameters(Mime::XML, raw_post_data) - - assert_equal "image/jpg", person['person']['avatars']['avatar'].first.content_type - assert_equal "me.jpg", person['person']['avatars']['avatar'].first.original_filename - assert_equal "ABC", person['person']['avatars']['avatar'].first.read - - assert_equal "image/gif", person['person']['avatars']['avatar'].last.content_type - assert_equal "you.gif", person['person']['avatars']['avatar'].last.original_filename - assert_equal "DEF", person['person']['avatars']['avatar'].last.read - end -end - - class MultipartCGITest < Test::Unit::TestCase FIXTURE_PATH = File.dirname(__FILE__) + '/../fixtures/multipart' @@ -379,15 +350,11 @@ class MultipartCGITest < Test::Unit::TestCase private def process(name) - old_stdin = $stdin File.open(File.join(FIXTURE_PATH, name), 'rb') do |file| ENV['CONTENT_LENGTH'] = file.stat.size.to_s - $stdin = file - @cgi = CGI.new + @cgi = CGI.new('query', file) CGI.parse_request_parameters @cgi.params end - ensure - $stdin = old_stdin end end -- cgit v1.2.3