aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test')
-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