From fef174f5c524edacbcad846d68400e7fe114a15a Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Wed, 1 May 2019 13:33:38 +0900 Subject: `@controller` may not be defined here, and if so, it causes a Ruby warning e.g. via test-unit-rails' `run_setup` --- actionview/lib/action_view/test_case.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionview/lib/action_view') diff --git a/actionview/lib/action_view/test_case.rb b/actionview/lib/action_view/test_case.rb index e14f7aaec7..3a75633743 100644 --- a/actionview/lib/action_view/test_case.rb +++ b/actionview/lib/action_view/test_case.rb @@ -284,7 +284,7 @@ module ActionView def respond_to_missing?(name, include_private = false) begin - routes = @controller.respond_to?(:_routes) && @controller._routes + routes = defined?(@controller) && @controller.respond_to?(:_routes) && @controller._routes rescue # Don't call routes, if there is an error on _routes call end -- cgit v1.2.3