diff options
Diffstat (limited to 'actionpack/test/dispatch/request')
5 files changed, 12 insertions, 18 deletions
diff --git a/actionpack/test/dispatch/request/json_params_parsing_test.rb b/actionpack/test/dispatch/request/json_params_parsing_test.rb index 0faa99a912..34db7a4c66 100644 --- a/actionpack/test/dispatch/request/json_params_parsing_test.rb +++ b/actionpack/test/dispatch/request/json_params_parsing_test.rb @@ -1,6 +1,6 @@ require 'abstract_unit' -class JsonParamsParsingTest < ActionController::IntegrationTest +class JsonParamsParsingTest < ActionDispatch::IntegrationTest class TestController < ActionController::Base class << self attr_accessor :last_request_parameters @@ -56,7 +56,7 @@ class JsonParamsParsingTest < ActionController::IntegrationTest def with_test_routing with_routing do |set| - set.draw do |map| + set.draw do match ':action', :to => ::JsonParamsParsingTest::TestController end yield diff --git a/actionpack/test/dispatch/request/multipart_params_parsing_test.rb b/actionpack/test/dispatch/request/multipart_params_parsing_test.rb index e3ec5cf182..3ff558ec5a 100644 --- a/actionpack/test/dispatch/request/multipart_params_parsing_test.rb +++ b/actionpack/test/dispatch/request/multipart_params_parsing_test.rb @@ -1,6 +1,6 @@ require 'abstract_unit' -class MultipartParamsParsingTest < ActionController::IntegrationTest +class MultipartParamsParsingTest < ActionDispatch::IntegrationTest class TestController < ActionController::Base class << self attr_accessor :last_request_parameters @@ -36,7 +36,6 @@ class MultipartParamsParsingTest < ActionController::IntegrationTest assert_equal 'bar', params['foo'] file = params['file'] - assert_kind_of Tempfile, file assert_equal 'file.txt', file.original_filename assert_equal "text/plain", file.content_type assert_equal 'contents', file.read @@ -49,8 +48,6 @@ class MultipartParamsParsingTest < ActionController::IntegrationTest file = params['file'] foo = params['foo'] - assert_kind_of Tempfile, file - assert_equal 'file.txt', file.original_filename assert_equal "text/plain", file.content_type @@ -64,11 +61,9 @@ class MultipartParamsParsingTest < ActionController::IntegrationTest file = params['file'] - assert_kind_of Tempfile, file - assert_equal 'file.txt', file.original_filename assert_equal "text/plain", file.content_type - assert ('a' * 20480) == file.read + assert_equal(('a' * 20480), file.read) end test "parses binary file" do @@ -77,13 +72,11 @@ class MultipartParamsParsingTest < ActionController::IntegrationTest assert_equal 'bar', params['foo'] file = params['file'] - assert_kind_of Tempfile, file assert_equal 'file.csv', file.original_filename assert_nil file.content_type assert_equal 'contents', file.read file = params['flowers'] - assert_kind_of Tempfile, file assert_equal 'flowers.jpg', file.original_filename assert_equal "image/jpeg", file.content_type assert_equal 19512, file.size @@ -156,7 +149,7 @@ class MultipartParamsParsingTest < ActionController::IntegrationTest def with_test_routing with_routing do |set| - set.draw do |map| + set.draw do match ':action', :to => 'multipart_params_parsing_test/test' end yield diff --git a/actionpack/test/dispatch/request/query_string_parsing_test.rb b/actionpack/test/dispatch/request/query_string_parsing_test.rb index 071d80c5b0..f6a1475d04 100644 --- a/actionpack/test/dispatch/request/query_string_parsing_test.rb +++ b/actionpack/test/dispatch/request/query_string_parsing_test.rb @@ -1,6 +1,6 @@ require 'abstract_unit' -class QueryStringParsingTest < ActionController::IntegrationTest +class QueryStringParsingTest < ActionDispatch::IntegrationTest class TestController < ActionController::Base class << self attr_accessor :last_query_parameters @@ -108,7 +108,7 @@ class QueryStringParsingTest < ActionController::IntegrationTest private def assert_parses(expected, actual) with_routing do |set| - set.draw do |map| + set.draw do match ':action', :to => ::QueryStringParsingTest::TestController end diff --git a/actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb b/actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb index 0bcef81534..04a0fb6f34 100644 --- a/actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb +++ b/actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb @@ -1,6 +1,6 @@ require 'abstract_unit' -class UrlEncodedParamsParsingTest < ActionController::IntegrationTest +class UrlEncodedParamsParsingTest < ActionDispatch::IntegrationTest class TestController < ActionController::Base class << self attr_accessor :last_request_parameters, :last_request_type @@ -129,7 +129,7 @@ class UrlEncodedParamsParsingTest < ActionController::IntegrationTest private def with_test_routing with_routing do |set| - set.draw do |map| + set.draw do match ':action', :to => ::UrlEncodedParamsParsingTest::TestController end yield diff --git a/actionpack/test/dispatch/request/xml_params_parsing_test.rb b/actionpack/test/dispatch/request/xml_params_parsing_test.rb index d44c642420..ad9de02eb4 100644 --- a/actionpack/test/dispatch/request/xml_params_parsing_test.rb +++ b/actionpack/test/dispatch/request/xml_params_parsing_test.rb @@ -1,6 +1,6 @@ require 'abstract_unit' -class XmlParamsParsingTest < ActionController::IntegrationTest +class XmlParamsParsingTest < ActionDispatch::IntegrationTest class TestController < ActionController::Base class << self attr_accessor :last_request_parameters @@ -18,6 +18,7 @@ class XmlParamsParsingTest < ActionController::IntegrationTest test "parses a strict rack.input" do class Linted + undef call if method_defined?(:call) def call(env) bar = env['action_dispatch.request.request_parameters']['foo'] result = "<ok>#{bar}</ok>" @@ -96,7 +97,7 @@ class XmlParamsParsingTest < ActionController::IntegrationTest private def with_test_routing with_routing do |set| - set.draw do |map| + set.draw do match ':action', :to => ::XmlParamsParsingTest::TestController end yield |