diff options
author | Joshua Peek <josh@joshpeek.com> | 2008-12-18 13:14:09 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-12-18 13:14:09 -0600 |
commit | a9fde9a2abd6a6505d5fd197ad9640470d8df9be (patch) | |
tree | f115acdeed96396d52a35a875ce5270585db3bc5 /actionpack/test | |
parent | 3b35366d5df8c8d8a7b216c42dd96b0cfa38fee4 (diff) | |
download | rails-a9fde9a2abd6a6505d5fd197ad9640470d8df9be.tar.gz rails-a9fde9a2abd6a6505d5fd197ad9640470d8df9be.tar.bz2 rails-a9fde9a2abd6a6505d5fd197ad9640470d8df9be.zip |
Cleanup dispatch path
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/dispatcher_test.rb | 4 | ||||
-rw-r--r-- | actionpack/test/controller/rack_test.rb | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/actionpack/test/controller/dispatcher_test.rb b/actionpack/test/controller/dispatcher_test.rb index a183b69c99..fd06b4ea99 100644 --- a/actionpack/test/controller/dispatcher_test.rb +++ b/actionpack/test/controller/dispatcher_test.rb @@ -96,7 +96,9 @@ class DispatcherTest < Test::Unit::TestCase private def dispatch(cache_classes = true) - Dispatcher.any_instance.stubs(:handle_request).returns([200, {}, 'response']) + controller = mock() + controller.stubs(:process).returns([200, {}, 'response']) + ActionController::Routing::Routes.stubs(:recognize).returns(controller) Dispatcher.define_dispatcher_callbacks(cache_classes) @dispatcher.call({}) end diff --git a/actionpack/test/controller/rack_test.rb b/actionpack/test/controller/rack_test.rb index e2ec686c41..3a8a00b7d7 100644 --- a/actionpack/test/controller/rack_test.rb +++ b/actionpack/test/controller/rack_test.rb @@ -236,7 +236,7 @@ class RackResponseTest < BaseRackTest @response.body = "Hello, World!" @response.prepare! - status, headers, body = @response.out + status, headers, body = @response.to_a assert_equal "200 OK", status assert_equal({ "Content-Type" => "text/html; charset=utf-8", @@ -257,7 +257,7 @@ class RackResponseTest < BaseRackTest end @response.prepare! - status, headers, body = @response.out + status, headers, body = @response.to_a assert_equal "200 OK", status assert_equal({"Content-Type" => "text/html; charset=utf-8", "Cache-Control" => "no-cache", "Set-Cookie" => []}, headers) @@ -293,6 +293,6 @@ class RackResponseHeadersTest < BaseRackTest private def response_headers @response.prepare! - @response.out[1] + @response.to_a[1] end end |