aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/routing_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/controller/routing_test.rb')
-rw-r--r--actionpack/test/controller/routing_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb
index a39fede5b9..178cd41922 100644
--- a/actionpack/test/controller/routing_test.rb
+++ b/actionpack/test/controller/routing_test.rb
@@ -94,6 +94,18 @@ class LegacyRouteSetTests < ActiveSupport::TestCase
assert_equal({"artist"=>"journey", "song"=>"faithfully"}, hash)
end
+ def test_symbols_with_dashes_reversed
+ rs.draw do
+ get ':artist(/omg-:song)', :to => lambda { |env|
+ resp = ActiveSupport::JSON.encode ActionDispatch::Request.new(env).path_parameters
+ [200, {}, [resp]]
+ }
+ end
+
+ hash = ActiveSupport::JSON.decode get(URI('http://example.org/journey/omg-faithfully'))
+ assert_equal({"artist"=>"journey", "song"=>"faithfully"}, hash)
+ end
+
def test_id_with_dash
rs.draw do
get '/journey/:id', :to => lambda { |env|