diff options
Diffstat (limited to 'actionpack/lib/action_view/test_case.rb')
-rw-r--r-- | actionpack/lib/action_view/test_case.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/test_case.rb b/actionpack/lib/action_view/test_case.rb index 266cb14cde..a4e8068026 100644 --- a/actionpack/lib/action_view/test_case.rb +++ b/actionpack/lib/action_view/test_case.rb @@ -61,10 +61,9 @@ module ActionView end def determine_default_helper_class(name) - mod = name.sub(/Test$/, '').constantize - mod.is_a?(Class) ? nil : mod - rescue NameError - nil + determine_constant_from_test_name(name) do |constant| + Module === constant && !(Class === constant) + end end def helper_method(*methods) |