aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/routing_test.rb
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2010-09-18 13:32:54 +0100
committerAndrew White <andyw@pixeltrix.co.uk>2010-09-18 13:32:54 +0100
commit013ed1c0503e59dc8f1cfff1bd00d0e579c604a1 (patch)
tree62a36951319bb2ef1eb748a4953b444202493254 /actionpack/test/dispatch/routing_test.rb
parent5ff2b73b4806f135f7279604faf938239dc8ce36 (diff)
downloadrails-013ed1c0503e59dc8f1cfff1bd00d0e579c604a1.tar.gz
rails-013ed1c0503e59dc8f1cfff1bd00d0e579c604a1.tar.bz2
rails-013ed1c0503e59dc8f1cfff1bd00d0e579c604a1.zip
Remove leading slash from controller [#5651 state:resolved]
Diffstat (limited to 'actionpack/test/dispatch/routing_test.rb')
-rw-r--r--actionpack/test/dispatch/routing_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb
index 8a2311ab3e..b5a4674a16 100644
--- a/actionpack/test/dispatch/routing_test.rb
+++ b/actionpack/test/dispatch/routing_test.rb
@@ -457,6 +457,8 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
match '/cities', :to => 'countries#cities'
end
+ match '/feeds/:service', :to => '/api/feeds#show', :as => :feed
+
match '/countries/:country/(*other)', :to => redirect{ |params, req| params[:other] ? "/countries/all/#{params[:other]}" : '/countries/all' }
match '/:locale/*file.:format', :to => 'files#show', :file => /path\/to\/existing\/file/
@@ -2128,6 +2130,12 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
assert_raises(ActionController::RoutingError){ list_todo_path(:list_id => '2', :id => '1') }
end
+ def test_controller_has_leading_slash_removed
+ get '/feeds/twitter.xml'
+ assert_equal 'api/feeds#show', @response.body
+ assert_equal '/feeds/twitter.xml', feed_path(:service => 'twitter', :format => 'xml')
+ end
+
private
def with_test_routes
yield