aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/routing
diff options
context:
space:
mode:
authorAmr Tamimi <amrnt0@gmail.com>2013-10-21 15:40:39 +0300
committerAndrew White <andyw@pixeltrix.co.uk>2014-01-20 15:24:30 +0000
commit746abbcc31f795eaa8e31d7b3a94d63cc4d5c581 (patch)
tree5d710cec0ad5f39eab935023ea2cb053cb3b18c2 /actionpack/test/dispatch/routing
parent080fc9cad39a98b6973cd7a7106f1bcb10d3ad02 (diff)
downloadrails-746abbcc31f795eaa8e31d7b3a94d63cc4d5c581.tar.gz
rails-746abbcc31f795eaa8e31d7b3a94d63cc4d5c581.tar.bz2
rails-746abbcc31f795eaa8e31d7b3a94d63cc4d5c581.zip
Automatically convert dashes to underscores for url helpers
Diffstat (limited to 'actionpack/test/dispatch/routing')
-rw-r--r--actionpack/test/dispatch/routing/inspector_test.rb4
-rw-r--r--actionpack/test/dispatch/routing/route_set_test.rb2
2 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/test/dispatch/routing/inspector_test.rb b/actionpack/test/dispatch/routing/inspector_test.rb
index 18a52f13a7..2746c683ba 100644
--- a/actionpack/test/dispatch/routing/inspector_test.rb
+++ b/actionpack/test/dispatch/routing/inspector_test.rb
@@ -37,6 +37,7 @@ module ActionDispatch
end
engine.routes.draw do
get '/cart', :to => 'cart#show'
+ get '/view-cart', :to => 'cart#show'
end
output = draw do
@@ -50,7 +51,8 @@ module ActionDispatch
" blog /blog Blog::Engine",
"",
"Routes for Blog::Engine:",
- " cart GET /cart(.:format) cart#show"
+ " cart GET /cart(.:format) cart#show",
+ "view_cart GET /view-cart(.:format) cart#show"
], output
end
diff --git a/actionpack/test/dispatch/routing/route_set_test.rb b/actionpack/test/dispatch/routing/route_set_test.rb
index 0e488d2b88..3831c4c585 100644
--- a/actionpack/test/dispatch/routing/route_set_test.rb
+++ b/actionpack/test/dispatch/routing/route_set_test.rb
@@ -30,10 +30,12 @@ module ActionDispatch
draw do
get 'foo', to: SimpleApp.new('foo#index')
get 'bar', to: SimpleApp.new('bar#index')
+ get 'foo-bar', to: SimpleApp.new('bar#index')
end
assert_equal '/foo', url_helpers.foo_path
assert_equal '/bar', url_helpers.bar_path
+ assert_equal '/foo-bar', url_helpers.foo_bar_path
end
test "url helpers are updated when route is updated" do