aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/test_case.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionview/lib/action_view/test_case.rb')
-rw-r--r--actionview/lib/action_view/test_case.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/actionview/lib/action_view/test_case.rb b/actionview/lib/action_view/test_case.rb
index efe8c87b9b..6913c31a20 100644
--- a/actionview/lib/action_view/test_case.rb
+++ b/actionview/lib/action_view/test_case.rb
@@ -281,6 +281,18 @@ module ActionView
super
end
end
+
+ def respond_to_missing?(name, include_private = false)
+ begin
+ routes = @controller.respond_to?(:_routes) && @controller._routes
+ rescue
+ # Dont call routes, if there is an error on _routes call
+ end
+
+ routes &&
+ (routes.named_routes.route_defined?(name) ||
+ routes.mounted_helpers.method_defined?(name))
+ end
end
include Behavior