aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorNicholas Seckar <nseckar@gmail.com>2006-01-30 04:49:17 +0000
committerNicholas Seckar <nseckar@gmail.com>2006-01-30 04:49:17 +0000
commitd2adec438e2f70ea1228cefb5d592752cf720ac2 (patch)
tree7b4a4b876565aa1490123e3c27980d4cc7c6747d /actionpack/test/controller
parentf8bcfa6e042e7f953f1e7bd16195b2200a6dfc45 (diff)
downloadrails-d2adec438e2f70ea1228cefb5d592752cf720ac2.tar.gz
rails-d2adec438e2f70ea1228cefb5d592752cf720ac2.tar.bz2
rails-d2adec438e2f70ea1228cefb5d592752cf720ac2.zip
Ensure assigns are copied to the template when using render :update. Closes #3620.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3497 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/new_render_test.rb19
1 files changed, 18 insertions, 1 deletions
diff --git a/actionpack/test/controller/new_render_test.rb b/actionpack/test/controller/new_render_test.rb
index 0208912ece..997a49091d 100644
--- a/actionpack/test/controller/new_render_test.rb
+++ b/actionpack/test/controller/new_render_test.rb
@@ -194,6 +194,15 @@ class NewRenderTestController < ActionController::Base
page.visual_effect :highlight, 'balance'
end
end
+
+ def update_page_with_instance_variables
+ @money = '$37,000,000.00'
+ @div_id = 'balance'
+ render :update do |page|
+ page.replace_html @div_id, @money
+ page.visual_effect :highlight, @div_id
+ end
+ end
def action_talk_to_layout
# Action template sets variable that's picked up by layout
@@ -223,7 +232,7 @@ class NewRenderTestController < ActionController::Base
"render_with_explicit_template",
"render_js_with_explicit_template",
"render_js_with_explicit_action_template",
- "delete_with_js", "update_page"
+ "delete_with_js", "update_page", "update_page_with_instance_variables"
"layouts/standard"
when "builder_layout_test"
@@ -494,6 +503,14 @@ class NewRenderTest < Test::Unit::TestCase
assert_equal 2, @response.body.split($/).length
end
+ def test_update_page_with_instance_variables
+ get :update_page_with_instance_variables
+ assert_template nil
+ assert_equal 'text/javascript', @response.headers['Content-Type']
+ assert_match /balance/, @response.body
+ assert_match /\$37/, @response.body
+ end
+
def test_yield_content_for
get :yield_content_for
assert_equal "<title>Putting stuff in the title!</title>\n\nGreat stuff!\n", @response.body