From 0d1d33ce87d00790dbd82fed77ed9f18502d1874 Mon Sep 17 00:00:00 2001 From: Rizwan Reza Date: Tue, 5 Jan 2010 00:48:42 +0330 Subject: [PATCH] Failing test for using redirect method with URLs as arguments --- actionpack/test/dispatch/routing_test.rb | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index c4b0b9c..3e8c4a3 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -115,6 +115,9 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest match '/info' => 'projects#info', :as => 'info' root :to => 'projects#index' + + # Routes for failing tests + match 'account/google' => redirect("http://www.google.com/") end end @@ -497,6 +500,15 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest end end + def test_redirect_with_complete_url + with_test_routes do + get '/account/google' + assert_equal 301, @response.status + assert_equal 'http://www.google.com/', @response.headers['Location'] + assert_equal 'Moved Permanently', @response.body + end + end + private def with_test_routes real_routes, temp_routes = ActionController::Routing::Routes, Routes -- 1.6.5.2