From b71f83c9ccd0ecd1a047710f7b39309f51677119 Mon Sep 17 00:00:00 2001 From: Yehuda Katz Date: Thu, 15 Oct 2009 16:03:16 -0700 Subject: Work around apparent bug in 1.9 --- actionpack/test/abstract_unit.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionpack/test') diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index 0d65bdb5b9..f7a1564f90 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -176,8 +176,8 @@ class ::ApplicationController < ActionController::Base end module ActionController - class << Routing - def possible_controllers + module Routing + def self.possible_controllers @@possible_controllers ||= [] end end -- cgit v1.2.3 From 4869b74aeee2f6d0e88605b73d2bdb4f150cfb63 Mon Sep 17 00:00:00 2001 From: Yehuda Katz Date: Thu, 15 Oct 2009 16:27:26 -0700 Subject: Fix test to correctly handle 1.9 Array#to_s behavior --- actionpack/test/controller/new_base/content_negotiation_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/test') diff --git a/actionpack/test/controller/new_base/content_negotiation_test.rb b/actionpack/test/controller/new_base/content_negotiation_test.rb index 7b38a82f51..b98a22dfcc 100644 --- a/actionpack/test/controller/new_base/content_negotiation_test.rb +++ b/actionpack/test/controller/new_base/content_negotiation_test.rb @@ -5,7 +5,7 @@ module ContentNegotiation # This has no layout and it works class BasicController < ActionController::Base self.view_paths = [ActionView::FixtureResolver.new( - "content_negotiation/basic/hello.html.erb" => "Hello world <%= request.formats %>!" + "content_negotiation/basic/hello.html.erb" => "Hello world <%= request.formats.first.to_s %>!" )] end -- cgit v1.2.3 From e9d6bcd19fb4f6a7ae697339c555e2477e040ce1 Mon Sep 17 00:00:00 2001 From: Yehuda Katz Date: Thu, 15 Oct 2009 16:33:47 -0700 Subject: Update MetalTest for constant scoping change in 1.9 --- actionpack/test/controller/new_base/metal_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionpack/test') diff --git a/actionpack/test/controller/new_base/metal_test.rb b/actionpack/test/controller/new_base/metal_test.rb index e1d46b906e..ab61fd98ee 100644 --- a/actionpack/test/controller/new_base/metal_test.rb +++ b/actionpack/test/controller/new_base/metal_test.rb @@ -20,8 +20,8 @@ module MetalTest class TestMiddleware < ActiveSupport::TestCase def setup @app = Rack::Builder.new do - use MetalMiddleware - run Endpoint.new + use MetalTest::MetalMiddleware + run MetalTest::Endpoint.new end.to_app end -- cgit v1.2.3 From c44d560145cc332d48b9fbacbc7d23954ebb4a46 Mon Sep 17 00:00:00 2001 From: Yehuda Katz Date: Thu, 15 Oct 2009 16:37:27 -0700 Subject: Rack responses need to wrap Strings in 1.9 --- actionpack/test/controller/rescue_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/test') diff --git a/actionpack/test/controller/rescue_test.rb b/actionpack/test/controller/rescue_test.rb index 689359166f..054a9f2aaf 100644 --- a/actionpack/test/controller/rescue_test.rb +++ b/actionpack/test/controller/rescue_test.rb @@ -327,7 +327,7 @@ class RescueTest < ActionController::IntegrationTest test 'rescue routing exceptions' do @app = ActionDispatch::Rescue.new(ActionController::Routing::Routes) do - rescue_from ActionController::RoutingError, lambda { |env| [200, {"Content-Type" => "text/html"}, "Gotcha!"] } + rescue_from ActionController::RoutingError, lambda { |env| [200, {"Content-Type" => "text/html"}, ["Gotcha!"]] } end get '/b00m' -- cgit v1.2.3 From ef70ad5538c4ce02c4d31ef01a8db6b55c837571 Mon Sep 17 00:00:00 2001 From: Yehuda Katz Date: Thu, 15 Oct 2009 17:16:42 -0700 Subject: Fix a few more 1.9 bugs. Rack 1.0.1 is required for 1.9 compliance but not release, so bundling 1.0.1 from git --- actionpack/test/dispatch/test_request_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/test') diff --git a/actionpack/test/dispatch/test_request_test.rb b/actionpack/test/dispatch/test_request_test.rb index b8e340e055..b2006a0d2f 100644 --- a/actionpack/test/dispatch/test_request_test.rb +++ b/actionpack/test/dispatch/test_request_test.rb @@ -18,7 +18,7 @@ class TestRequestTest < ActiveSupport::TestCase assert_equal "0.0.0.0", env.delete("REMOTE_ADDR") assert_equal "Rails Testing", env.delete("HTTP_USER_AGENT") - assert_equal [0, 1], env.delete("rack.version") + assert_equal [1, 0], env.delete("rack.version") assert_equal "", env.delete("rack.input").string assert_kind_of StringIO, env.delete("rack.errors") assert_equal true, env.delete("rack.multithread") -- cgit v1.2.3