From b1999be5a7efd67e2602c37ed898aa8433661863 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 15 Feb 2005 01:45:35 +0000 Subject: A hopefully more successful attempt at the Routing branch merge git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@617 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/controller/helper_test.rb | 37 ++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 10 deletions(-) (limited to 'actionpack/test/controller/helper_test.rb') diff --git a/actionpack/test/controller/helper_test.rb b/actionpack/test/controller/helper_test.rb index b824e40125..0a9840f705 100644 --- a/actionpack/test/controller/helper_test.rb +++ b/actionpack/test/controller/helper_test.rb @@ -1,20 +1,30 @@ require File.dirname(__FILE__) + '/../abstract_unit' +$:.unshift(File.dirname(__FILE__) + '/../fixtures/helpers') -class HelperTest < Test::Unit::TestCase - HELPER_PATHS = %w(/../fixtures/helpers) +class TestController < ActionController::Base + attr_accessor :delegate_attr + def delegate_method() end + def rescue_action(e) raise end +end + +module Fun + class GamesController < ActionController::Base + def render_hello_world + render_template "hello: <%= stratego %>" + end - class TestController < ActionController::Base - attr_accessor :delegate_attr - def delegate_method() end def rescue_action(e) raise end end +end - module LocalAbcHelper - def a() end - def b() end - def c() end - end +module LocalAbcHelper + def a() end + def b() end + def c() end +end +class HelperTest < Test::Unit::TestCase + HELPER_PATHS = %w(/../fixtures/helpers) def setup # Increment symbol counter. @@ -102,6 +112,13 @@ class HelperTest < Test::Unit::TestCase assert template_methods.include?('delegate_attr=') end + def test_helper_for_nested_controller + @request = ActionController::TestRequest.new + @response = ActionController::TestResponse.new + @request.action = "render_hello_world" + + assert_equal "hello: Iz guuut!", Fun::GamesController.process(@request, @response).body + end private def helper_methods; TestHelper.instance_methods end -- cgit v1.2.3