aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorMike Moore <mike@blowmage.com>2012-09-24 15:37:45 -0600
committerMike Moore <mike@blowmage.com>2012-09-24 15:37:45 -0600
commitc0a24555f9e2749fb94efe1967cb9943db0b6a7e (patch)
treec3b61be191c7519b8725340f4fac51c93578348a /actionpack/lib
parent1949d1f6b29bd374e7e1cb015ec85ee78e52361a (diff)
downloadrails-c0a24555f9e2749fb94efe1967cb9943db0b6a7e.tar.gz
rails-c0a24555f9e2749fb94efe1967cb9943db0b6a7e.tar.bz2
rails-c0a24555f9e2749fb94efe1967cb9943db0b6a7e.zip
Support helper tests using spec DSL
Improve how helper tests to resolve the helper class from the test name. Add tests for helper tests using the minitest spec DSL.
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/test_case.rb7
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)