Make the helpers a required argument
This commit is contained in:
parent
43dae99645
commit
e002a68a4e
@ -8,9 +8,9 @@ class RoutesProxy #:nodoc:
|
||||
attr_accessor :scope, :routes
|
||||
alias :_routes :routes
|
||||
|
||||
def initialize(routes, scope, helpers=nil)
|
||||
def initialize(routes, scope, helpers)
|
||||
@routes, @scope = routes, scope
|
||||
@helpers = helpers || routes.url_helpers
|
||||
@helpers = helpers
|
||||
end
|
||||
|
||||
def url_options
|
||||
|
@ -113,7 +113,7 @@ def test_symbol_with_options
|
||||
|
||||
def test_passing_routes_proxy
|
||||
with_namespaced_routes(:blog) do
|
||||
proxy = ActionDispatch::Routing::RoutesProxy.new(_routes, self)
|
||||
proxy = ActionDispatch::Routing::RoutesProxy.new(_routes, self, _routes.url_helpers)
|
||||
@blog_post.save
|
||||
assert_url "http://example.com/posts/#{@blog_post.id}", [proxy, @blog_post]
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user