aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/routing_test.rb
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2010-06-24 11:48:05 +0100
committerJosé Valim <jose.valim@gmail.com>2010-06-24 13:26:24 +0200
commitdf15ba7eadb180626474161741f901e675f517ce (patch)
tree244d1990ccd49af5d4f2e699c4a355b7c13cf345 /actionpack/test/dispatch/routing_test.rb
parent176c386409fd57bc03b9ebf1570a8955e21e0800 (diff)
downloadrails-df15ba7eadb180626474161741f901e675f517ce.tar.gz
rails-df15ba7eadb180626474161741f901e675f517ce.tar.bz2
rails-df15ba7eadb180626474161741f901e675f517ce.zip
Fix namespaced redirects [#4389 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/test/dispatch/routing_test.rb')
-rw-r--r--actionpack/test/dispatch/routing_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb
index 58a1fa0518..8f43b5f934 100644
--- a/actionpack/test/dispatch/routing_test.rb
+++ b/actionpack/test/dispatch/routing_test.rb
@@ -300,6 +300,11 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
match '/' => 'mes#index'
end
+ namespace :private do
+ root :to => redirect('/private/index')
+ match "index", :to => 'private#index'
+ end
+
match "whatever/:controller(/:action(/:id))"
resource :profile do
@@ -421,6 +426,15 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
end
end
+ def test_namespace_redirect
+ with_test_routes do
+ get '/private'
+ assert_equal 301, @response.status
+ assert_equal 'http://www.example.com/private/index', @response.headers['Location']
+ assert_equal 'Moved Permanently', @response.body
+ end
+ end
+
def test_session_singleton_resource
with_test_routes do
get '/session'