From 1d4d037b0d74fbc3c1cad1c192a6ea7278aff081 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 4 Sep 2006 20:54:10 +0000 Subject: Added access to nested attributes in RJS (closes #4548) [richcollins@gmail.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5004 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/template/prototype_helper_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'actionpack/test/template/prototype_helper_test.rb') diff --git a/actionpack/test/template/prototype_helper_test.rb b/actionpack/test/template/prototype_helper_test.rb index 719a2f83ab..3954e38dcd 100644 --- a/actionpack/test/template/prototype_helper_test.rb +++ b/actionpack/test/template/prototype_helper_test.rb @@ -262,6 +262,16 @@ Element.update("baz", "

This is a test

"); @generator['hello'].hide assert_equal %($("hello").hide();), @generator.to_s end + + def test_element_proxy_variable_access + @generator['hello']['style'] + assert_equal %($("hello").style;), @generator.to_s + end + + def test_element_proxy_variable_access_with_assignment + @generator['hello']['style']['color'] = 'red' + assert_equal %($("hello").style.color = "red";), @generator.to_s + end def test_element_proxy_assignment @generator['hello'].width = 400 -- cgit v1.2.3