aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/test_case.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view/test_case.rb')
-rw-r--r--actionpack/lib/action_view/test_case.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/test_case.rb b/actionpack/lib/action_view/test_case.rb
index 23b0c6e121..ddea9cfd92 100644
--- a/actionpack/lib/action_view/test_case.rb
+++ b/actionpack/lib/action_view/test_case.rb
@@ -142,8 +142,13 @@ module ActionView
end
end
+ def _router
+ @controller._router if @controller.respond_to?(:_router)
+ end
+
def method_missing(selector, *args)
- if @controller._router.named_routes.helpers.include?(selector)
+ if @controller.respond_to?(:_router) &&
+ @controller._router.named_routes.helpers.include?(selector)
@controller.__send__(selector, *args)
else
super