diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-02-12 18:48:08 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-02-12 18:48:08 +0000 |
commit | ebdb766e7956520e9e5a784e280a8f1916f50511 (patch) | |
tree | 14749af9395b225cc609e4b1e12fcb84723f942a /actionpack/test/template/prototype_helper_test.rb | |
parent | a32a9863640dbd7a74b251e5467f90d134396110 (diff) | |
download | rails-ebdb766e7956520e9e5a784e280a8f1916f50511.tar.gz rails-ebdb766e7956520e9e5a784e280a8f1916f50511.tar.bz2 rails-ebdb766e7956520e9e5a784e280a8f1916f50511.zip |
Added element and collection proxies to RJS [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3587 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/template/prototype_helper_test.rb')
-rw-r--r-- | actionpack/test/template/prototype_helper_test.rb | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/actionpack/test/template/prototype_helper_test.rb b/actionpack/test/template/prototype_helper_test.rb index fc4ebeccc3..8657b1f107 100644 --- a/actionpack/test/template/prototype_helper_test.rb +++ b/actionpack/test/template/prototype_helper_test.rb @@ -227,4 +227,27 @@ new Insertion.Bottom("element", "<p>This is a test</p>"); Element.update("baz", "<p>This is a test</p>"); EOS end -end + + def test_element_access + assert_equal %($('hello');), @generator['hello'] + end + + def test_element_proxy_one_deep + @generator['hello'].hide + assert_equal %($('hello').hide();), @generator.to_s + end + + def test_element_proxy_two_deep + @generator['hello'].hide("first").display + assert_equal %($('hello').hide("first").display();), @generator.to_s + end + + def test_select_access + assert_equal %($$('div.hello');), @generator.select('div.hello') + end + + def test_select_proxy_one_deep + @generator.select('p.welcome b').first.hide + assert_equal %($$('p.welcome b').first().hide();), @generator.to_s + end +end
\ No newline at end of file |