diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2007-04-30 01:17:56 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2007-04-30 01:17:56 +0000 |
commit | da257eb81ba1eab76ef2c1a256916193858418d4 (patch) | |
tree | 3b472ae6730ce177c6a496da0ea2b15ab988942d /actionpack/test/template | |
parent | 0dc70383097f1212fa7d9b21c57e31cfd4b7204c (diff) | |
download | rails-da257eb81ba1eab76ef2c1a256916193858418d4.tar.gz rails-da257eb81ba1eab76ef2c1a256916193858418d4.tar.bz2 rails-da257eb81ba1eab76ef2c1a256916193858418d4.zip |
Added the first part of Simply Helpful to core. The rest is pending a clean integartion of polymorphic urls [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6633 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/template')
-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 |