From acb244778587ff400f5b1d54e27028a2dae91101 Mon Sep 17 00:00:00 2001 From: Yehuda Katz + Carl Lerche Date: Tue, 9 Jun 2009 14:50:01 -0700 Subject: Write documentation for AbstractController::Helpers --- actionpack/test/controller/helper_test.rb | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'actionpack/test/controller') diff --git a/actionpack/test/controller/helper_test.rb b/actionpack/test/controller/helper_test.rb index 342cbfbcd3..515c4c9f52 100644 --- a/actionpack/test/controller/helper_test.rb +++ b/actionpack/test/controller/helper_test.rb @@ -127,7 +127,11 @@ class HelperTest < Test::Unit::TestCase end def test_all_helpers - methods = AllHelpersController.master_helper_module.instance_methods.map {|m| m.to_s} + methods = if defined?(ActionController::Http) + AllHelpersController._helpers.instance_methods.map {|m| m.to_s} + else + AllHelpersController.master_helper_module.instance_methods.map {|m| m.to_s} + end # abc_helper.rb assert methods.include?('bare_a') @@ -143,7 +147,12 @@ class HelperTest < Test::Unit::TestCase @controller_class.helpers_dir = File.dirname(__FILE__) + '/../fixtures/alternate_helpers' # Reload helpers - @controller_class.master_helper_module = Module.new + if defined?(ActionController::Http) + @controller_class._helpers = Module.new + else + @controller_class.master_helper_module = Module.new + end + @controller_class.helper :all # helpers/abc_helper.rb should not be included @@ -175,7 +184,11 @@ class HelperTest < Test::Unit::TestCase end def master_helper_methods - @controller_class.master_helper_module.instance_methods.map {|m| m.to_s } + if defined?(ActionController::Http) + @controller_class._helpers.instance_methods.map {|m| m.to_s } + else + @controller_class.master_helper_module.instance_methods.map {|m| m.to_s } + end end def missing_methods -- cgit v1.2.3