Module: ActionView::TestCase::Behavior::ClassMethods
- Defined in:
- actionpack/lib/action_view/test_case.rb
Instance Attribute Summary (collapse)
Instance Method Summary (collapse)
- - (Object) determine_default_helper_class(name)
- - (Object) helper_method(*methods)
- - (Object) new
- - (Object) tests(helper_class)
Instance Attribute Details
- (Object) helper_class
73 74 75 |
# File 'actionpack/lib/action_view/test_case.rb', line 73 def helper_class @helper_class ||= determine_default_helper_class(name) end |
Instance Method Details
- (Object) determine_default_helper_class(name)
53 54 55 56 57 58 |
# File 'actionpack/lib/action_view/test_case.rb', line 53 def determine_default_helper_class(name) mod = name.sub(/Test$/, '').constantize mod.is_a?(Class) ? nil : mod rescue NameError nil end |
- (Object) helper_method(*methods)
60 61 62 63 64 65 66 67 68 69 |
# File 'actionpack/lib/action_view/test_case.rb', line 60 def helper_method(*methods) # Almost a duplicate from ActionController::Helpers methods.flatten.each do |method| _helpers.module_eval <<-end_eval def #{method}(*args, &block) # def current_user(*args, &block) _test_case.send(%(#{method}), *args, &block) # test_case.send(%(current_user), *args, &block) end # end end_eval end end |
- (Object) new
77 78 79 80 |
# File 'actionpack/lib/action_view/test_case.rb', line 77 def new(*) include_helper_modules! super end |
- (Object) tests(helper_class)
49 50 51 |
# File 'actionpack/lib/action_view/test_case.rb', line 49 def tests(helper_class) self.helper_class = helper_class end |