From b546945b51d1e5765b4bf4eba0bd8413ea8e4198 Mon Sep 17 00:00:00 2001 From: wycats Date: Sun, 4 Apr 2010 13:00:22 -0700 Subject: Reapply redirect {|params, request| } with passing tests this time --- actionpack/test/dispatch/routing_test.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'actionpack/test/dispatch/routing_test.rb') diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index bb7c322790..6ff478aec1 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -39,6 +39,8 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest match 'account/modulo/:name', :to => redirect("/%{name}s") match 'account/proc/:name', :to => redirect {|params| "/#{params[:name].pluralize}" } + match 'account/proc_req' => redirect {|params, req| "/#{req.method}" } + match 'account/google' => redirect('http://www.google.com/') match 'openid/login', :via => [:get, :post], :to => "openid#login" @@ -351,6 +353,15 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest end end + def test_redirect_proc_with_request + with_test_routes do + get '/account/proc_req' + assert_equal 301, @response.status + assert_equal 'http://www.example.com/GET', @response.headers['Location'] + assert_equal 'Moved Permanently', @response.body + end + end + def test_openid with_test_routes do get '/openid/login' -- cgit v1.2.3