提交 71873398 编写于 作者: A Aaron Patterson

make the routes reader private

nobody should be touching the routes hash without going through the
NamedRouteCollection object.
上级 62383dde
......@@ -89,6 +89,7 @@ def merge_default_action!(params)
class NamedRouteCollection
include Enumerable
attr_reader :routes, :url_helpers_module, :path_helpers_module
private :routes
def initialize
@routes = {}
......
......@@ -49,7 +49,7 @@ def app
def test_app_name_is_properly_generated_when_engine_is_mounted_in_resources
assert Router.mounted_helpers.method_defined?(:user_fake_mounted_at_resource),
"A mounted helper should be defined with a parent's prefix"
assert Router.named_routes.routes[:user_fake_mounted_at_resource],
assert Router.named_routes.key?(:user_fake_mounted_at_resource),
"A named route should be defined with a parent's prefix"
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册