diff options
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/helper_test.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/actionpack/test/controller/helper_test.rb b/actionpack/test/controller/helper_test.rb index 4f8ff4140f..9093fa9e17 100644 --- a/actionpack/test/controller/helper_test.rb +++ b/actionpack/test/controller/helper_test.rb @@ -25,8 +25,27 @@ class AllHelpersController < ActionController::Base helper :all end +module ImpressiveLibrary + extend ActiveSupport::Concern + included do + helper_method :useful_function + end + + def useful_function() end +end + +ActionController::Base.send :include, ImpressiveLibrary + class JustMeController < ActionController::Base clear_helpers + + def flash + render :inline => "<h1><%= notice %></h1>" + end + + def lib + render :inline => '<%= useful_function %>' + end end class MeTooController < JustMeController @@ -104,6 +123,18 @@ class HelperTest < ActiveSupport::TestCase assert_equal [MeTooHelper, JustMeHelper], MeTooController._helpers.ancestors.reject(&:anonymous?) end + def test_base_helper_methods_after_clear_helpers + assert_nothing_raised do + call_controller(JustMeController, "flash") + end + end + + def test_lib_helper_methods_after_clear_helpers + assert_nothing_raised do + call_controller(JustMeController, "lib") + end + end + def test_all_helpers methods = AllHelpersController._helpers.instance_methods.map {|m| m.to_s} |