Skip to content

Commit

Permalink
Fix cases where the wrong name is passed to Formatter#generate
Browse files Browse the repository at this point in the history
These are currently working "by accident" because `match_route` does not check
that the name is valid.
  • Loading branch information
chancancode committed Nov 23, 2014
1 parent b7b9e92 commit 938d130
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion actionpack/test/controller/routing_test.rb
Expand Up @@ -1386,7 +1386,7 @@ def test_named_routes_are_never_relative_to_modules
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
Expand Down
2 changes: 1 addition & 1 deletion actionpack/test/journey/router_test.rb
Expand Up @@ -415,7 +415,7 @@ def test_generate_uses_recall_if_needed

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",
Expand Down

0 comments on commit 938d130

Please sign in to comment.