mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Named routes are public methods
This commit is contained in:
parent
dbd30b0d27
commit
35a15af7a5
2 changed files with 2 additions and 2 deletions
|
@ -182,7 +182,7 @@ module ActionDispatch
|
|||
# ROUTES TODO: These assertions should really work in an integration context
|
||||
def method_missing(selector, *args, &block)
|
||||
if defined?(@controller) && @controller && defined?(@routes) && @routes && @routes.named_routes.route_defined?(selector)
|
||||
@controller.send(selector, *args, &block)
|
||||
@controller.public_send(selector, *args, &block)
|
||||
else
|
||||
super
|
||||
end
|
||||
|
|
|
@ -1326,7 +1326,7 @@ class ResourcesTest < ActionController::TestCase
|
|||
end
|
||||
|
||||
def assert_named_route(expected, route, options)
|
||||
actual = @controller.send(route, options) rescue $!.class.name
|
||||
actual = @controller.public_send(route, options) rescue $!.class.name
|
||||
assert_equal expected, actual, "Error on route: #{route}(#{options.inspect})"
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue