Skip to content

Commit fef174f

Browse files
committed
@controller may not be defined here, and if so, it causes a Ruby warning
e.g. via test-unit-rails' `run_setup`
1 parent 0c152f2 commit fef174f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

actionview/lib/action_view/test_case.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def method_missing(selector, *args)
284284

285285
def respond_to_missing?(name, include_private = false)
286286
begin
287-
routes = @controller.respond_to?(:_routes) && @controller._routes
287+
routes = defined?(@controller) && @controller.respond_to?(:_routes) && @controller._routes
288288
rescue
289289
# Don't call routes, if there is an error on _routes call
290290
end

0 commit comments

Comments
 (0)