diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2006-10-09 01:26:35 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2006-10-09 01:26:35 +0000 |
commit | a307b8c7dcc290705fbc06136622c004ea17976a (patch) | |
tree | 41accfe6487484e2ad6f24adc8221c7b224a1ada /actionpack/test | |
parent | bc85e6ac4c6c11e9f0009bded6cb31940f80e803 (diff) | |
download | rails-a307b8c7dcc290705fbc06136622c004ea17976a.tar.gz rails-a307b8c7dcc290705fbc06136622c004ea17976a.tar.bz2 rails-a307b8c7dcc290705fbc06136622c004ea17976a.zip |
render_text may optionally append to the response body. render_javascript appends by default. This allows you to chain multiple render :update calls by setting @performed_render = false between them (awaiting a better public API).
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5253 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/render_test.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb index 6e37a7f142..66429662e6 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -43,6 +43,15 @@ class TestController < ActionController::Base render_text "hello world", "404 Moved" end + def render_text_appendix + render_text "hello world" + render_text ", goodbye!", "404 Not Found", true + end + + def render_nothing_with_appendix + render_text "appended", nil, true + end + def render_xml_hello @name = "David" render "test/hello" @@ -160,6 +169,18 @@ class RenderTest < Test::Unit::TestCase assert_response 404 end + def test_do_with_render_text_appendix + get :render_text_appendix + assert_response 404 + assert_equal 'hello world, goodbye!', @response.body + end + + def test_do_with_render_nothing_with_appendix + get :render_nothing_with_appendix + assert_response 200 + assert_equal 'appended', @response.body + end + def test_attempt_to_access_object_method assert_raises(ActionController::UnknownAction, "No action responded to [clone]") { get :clone } end |