diff options
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/helper_test.rb | 26 | ||||
-rw-r--r-- | actionpack/test/fixtures/helpers/fun/pdf_helper.rb | 3 |
2 files changed, 24 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 diff --git a/actionpack/test/fixtures/helpers/fun/pdf_helper.rb b/actionpack/test/fixtures/helpers/fun/pdf_helper.rb new file mode 100644 index 0000000000..1890f6c9ec --- /dev/null +++ b/actionpack/test/fixtures/helpers/fun/pdf_helper.rb @@ -0,0 +1,3 @@ +module Fun::PDFHelper + def foobar() 'baz' end +end |