diff options
Diffstat (limited to 'actionpack/test/template/prototype_helper_test.rb')
-rw-r--r-- | actionpack/test/template/prototype_helper_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/template/prototype_helper_test.rb b/actionpack/test/template/prototype_helper_test.rb index cc8b650039..ef658517ff 100644 --- a/actionpack/test/template/prototype_helper_test.rb +++ b/actionpack/test/template/prototype_helper_test.rb @@ -1,5 +1,7 @@ require "#{File.dirname(__FILE__)}/../abstract_unit" +Bunny = Struct.new(:Bunny, :id) + module BaseTest include ActionView::Helpers::JavaScriptHelper include ActionView::Helpers::PrototypeHelper @@ -253,6 +255,11 @@ Element.update("baz", "<p>This is a test</p>"); assert_equal %($("hello");), @generator['hello'] end + def test_element_access_on_records + assert_equal %($("bunny_5");), @generator[Bunny.new(:id => 5)] + assert_equal %($("new_bunny");), @generator[Bunny.new] + end + def test_element_proxy_one_deep @generator['hello'].hide assert_equal %($("hello").hide();), @generator.to_s |