aboutsummaryrefslogblamecommitdiffstats
path: root/actionpack/test/abstract_controller/helper_test.rb
blob: 81dbee3065789236dd53d07338a78b0de65cba8a (plain) (tree)






































                                                                                   
require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper")

module AbstractController
  module Testing
  
    class ControllerWithHelpers < AbstractController::Base
      include Renderer
      include Helpers
      
      append_view_path File.expand_path(File.join(File.dirname(__FILE__), "views"))
    end
   
    module HelperyTest
      def included_method
        "Included"
      end
    end
   
    class MyHelpers1 < ControllerWithHelpers
      helper(HelperyTest) do
        def helpery_test
          "World"
        end
      end
      
      def index
        render "helper_test.erb"
      end
    end
    
    class TestHelpers < ActiveSupport::TestCase
      def test_helpers
        result = MyHelpers1.process(:index)
        assert_equal "Hello World : Included", result.response_obj[:body]
      end
    end
    
  end
end