aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/prototype_helper_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-12-22 18:05:50 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-12-22 18:05:50 +0000
commit4e76ae39047b369a192ee1a55cfcb4418c5c1f93 (patch)
tree378c9860306b682b6da6c39c3728b9e6a3538c45 /actionpack/test/template/prototype_helper_test.rb
parent778d6704d496f7812495e423aa27b54187db682a (diff)
downloadrails-4e76ae39047b369a192ee1a55cfcb4418c5c1f93.tar.gz
rails-4e76ae39047b369a192ee1a55cfcb4418c5c1f93.tar.bz2
rails-4e76ae39047b369a192ee1a55cfcb4418c5c1f93.zip
Added delayed execution of Javascript from within RJS (closes #3264) [devslashnull@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3335 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/template/prototype_helper_test.rb')
-rw-r--r--actionpack/test/template/prototype_helper_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/test/template/prototype_helper_test.rb b/actionpack/test/template/prototype_helper_test.rb
index 56485bc21c..eef6841727 100644
--- a/actionpack/test/template/prototype_helper_test.rb
+++ b/actionpack/test/template/prototype_helper_test.rb
@@ -201,6 +201,14 @@ class JavaScriptGeneratorTest < Test::Unit::TestCase
@generator.redirect_to(:action => 'welcome')
end
+ def test_delay
+ @generator.delay(20) do
+ @generator.hide('foo')
+ end
+
+ assert_equal "setTimeout(function() {\n;\nElement.hide(\"foo\");\n}, 20000);", @generator.to_s
+ end
+
def test_to_s
@generator.insert_html(:top, 'element', '<p>This is a test</p>')
@generator.insert_html(:bottom, 'element', '<p>This is a test</p>')