aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2008-08-30 21:42:53 +0100
committerPratik Naik <pratiknaik@gmail.com>2008-08-30 21:47:35 +0100
commit4fb75392aa12228764758dfda95f02f83b8ce3fe (patch)
tree84cf907cbc7a3c4be1f33b36e9c05bf865853f14 /actionpack
parente12abb6e8a454775c31ec9e282d5abf9246a9e4a (diff)
downloadrails-4fb75392aa12228764758dfda95f02f83b8ce3fe.tar.gz
rails-4fb75392aa12228764758dfda95f02f83b8ce3fe.tar.bz2
rails-4fb75392aa12228764758dfda95f02f83b8ce3fe.zip
Add test to make sure RJS block inside controller is executed in view context
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/test/controller/render_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb
index e383fda384..8d15aa2da4 100644
--- a/actionpack/test/controller/render_test.rb
+++ b/actionpack/test/controller/render_test.rb
@@ -371,6 +371,12 @@ class TestController < ActionController::Base
end
end
+ def update_page_with_view_method
+ render :update do |page|
+ page.replace_html 'person', pluralize(2, 'person')
+ end
+ end
+
def action_talk_to_layout
# Action template sets variable that's picked up by layout
end
@@ -1022,6 +1028,13 @@ class RenderTest < Test::Unit::TestCase
assert_match /\$37/, @response.body
end
+ def test_update_page_with_view_method
+ get :update_page_with_view_method
+ assert_template nil
+ assert_equal 'text/javascript; charset=utf-8', @response.headers['type']
+ assert_match /2 people/, @response.body
+ end
+
def test_yield_content_for
assert_not_deprecated { get :yield_content_for }
assert_equal "<title>Putting stuff in the title!</title>\n\nGreat stuff!\n", @response.body