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.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/test_case.rb b/actionpack/lib/action_view/test_case.rb
index 434fc8cc14..a4e8068026 100644
--- a/actionpack/lib/action_view/test_case.rb
+++ b/actionpack/lib/action_view/test_case.rb
@@ -30,6 +30,9 @@ module ActionView
end
end
+ # Use AV::TestCase for the base class for helpers and views
+ register_spec_type(/(Helper|View)( ?Test)?\z/i, self)
+
module Behavior
extend ActiveSupport::Concern
@@ -58,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)