aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/helper_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2005-11-08 08:23:13 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2005-11-08 08:23:13 +0000
commit85baf07be82b7e4313c6eeeebdd365a6f45fd405 (patch)
tree808dd03a391234ec0ab90dec1df9537c07b7f0b9 /actionpack/test/controller/helper_test.rb
parenta90fdec0311a73ee093344650550253ecc6d28d7 (diff)
downloadrails-85baf07be82b7e4313c6eeeebdd365a6f45fd405.tar.gz
rails-85baf07be82b7e4313c6eeeebdd365a6f45fd405.tar.bz2
rails-85baf07be82b7e4313c6eeeebdd365a6f45fd405.zip
Controllers with acronyms in their names (e.g. PDFController) require the correct default helper (PDFHelper in file pdf_helper.rb). Closes #2262. Do not raise an exception when default helper is missing; log a debug message instead. It's nice to delete empty helpers.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2938 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller/helper_test.rb')
-rw-r--r--actionpack/test/controller/helper_test.rb26
1 files changed, 21 insertions, 5 deletions
diff --git a/actionpack/test/controller/helper_test.rb b/actionpack/test/controller/helper_test.rb
index cd48704e3a..6fb67ee38e 100644
--- a/actionpack/test/controller/helper_test.rb
+++ b/actionpack/test/controller/helper_test.rb
@@ -14,6 +14,14 @@ module Fun
def rescue_action(e) raise end
end
+
+ class PDFController < ActionController::Base
+ def test
+ render :inline => "test: <%= foobar %>"
+ end
+
+ def rescue_action(e) raise end
+ end
end
module LocalAbcHelper
@@ -100,11 +108,19 @@ class HelperTest < Test::Unit::TestCase
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
+ 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
+
+ def test_helper_for_acronym_controller
+ request = ActionController::TestRequest.new
+ response = ActionController::TestResponse.new
+ request.action = 'test'
+
+ assert_equal 'test: baz', Fun::PDFController.process(request, response).body
end
private