From 35a15af7a51de2a49317df26ca251feba7c1b5e4 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Fri, 2 Oct 2020 12:55:17 +0900 Subject: [PATCH] Named routes are public methods --- actionpack/lib/action_dispatch/testing/assertions/routing.rb | 2 +- actionpack/test/controller/resources_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/actionpack/lib/action_dispatch/testing/assertions/routing.rb b/actionpack/lib/action_dispatch/testing/assertions/routing.rb index 57e17fb330..5cd0459915 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/routing.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/routing.rb @@ -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 diff --git a/actionpack/test/controller/resources_test.rb b/actionpack/test/controller/resources_test.rb index 92e574f2b8..d56d8ccb12 100644 --- a/actionpack/test/controller/resources_test.rb +++ b/actionpack/test/controller/resources_test.rb @@ -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