aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorGodfrey Chan <godfreykfc@gmail.com>2014-11-23 01:08:53 -0800
committerGodfrey Chan <godfreykfc@gmail.com>2014-11-23 01:08:53 -0800
commit938d130c62b530d3445c9f06933cb113ff477fed (patch)
treeef25b0d56b764e742bbb94d737de8781f8c1da0a /actionpack
parentb7b9e92093ed128c2b27a64c5732f6a98191cbf0 (diff)
downloadrails-938d130c62b530d3445c9f06933cb113ff477fed.tar.gz
rails-938d130c62b530d3445c9f06933cb113ff477fed.tar.bz2
rails-938d130c62b530d3445c9f06933cb113ff477fed.zip
Fix cases where the wrong name is passed to `Formatter#generate`
These are currently working "by accident" because `match_route` does not check that the name is valid.
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/test/controller/routing_test.rb2
-rw-r--r--actionpack/test/journey/router_test.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb
index aca9f03748..f46b32e019 100644
--- a/actionpack/test/controller/routing_test.rb
+++ b/actionpack/test/controller/routing_test.rb
@@ -1386,7 +1386,7 @@ class RouteSetTest < ActiveSupport::TestCase
url = controller.url_for({ :controller => "connection", :only_path => true })
assert_equal "/connection/connection", url
- url = controller.url_for({ :use_route => :family_connection,
+ url = controller.url_for({ :use_route => "family_connection",
:controller => "connection", :only_path => true })
assert_equal "/connection", url
end
diff --git a/actionpack/test/journey/router_test.rb b/actionpack/test/journey/router_test.rb
index fbac86e8ca..19c61b5914 100644
--- a/actionpack/test/journey/router_test.rb
+++ b/actionpack/test/journey/router_test.rb
@@ -415,7 +415,7 @@ module ActionDispatch
def test_generate_with_name
path = Path::Pattern.from_string '/:controller(/:action)'
- @router.routes.add_route @app, path, {}, {}, {}
+ @router.routes.add_route @app, path, {}, {}, "tasks"
path, params = @formatter.generate(
"tasks",