aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorErik St. Martin <alakriti@gmail.com>2010-01-26 12:40:29 -0500
committerStefan Penner <stefan.penner@gmail.com>2010-01-27 12:44:35 -0600
commitf661a3bc599ac336aeaf643a8d1d388fe905a07d (patch)
tree7d0e0557f4dc531106f56ea6963c6ab8326a69b3 /actionpack/test
parenta6cd35ba68c6d210f097a37ff737bbc1e5c61972 (diff)
downloadrails-f661a3bc599ac336aeaf643a8d1d388fe905a07d.tar.gz
rails-f661a3bc599ac336aeaf643a8d1d388fe905a07d.tar.bz2
rails-f661a3bc599ac336aeaf643a8d1d388fe905a07d.zip
removing container inline js function of observed elements :function callback
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/ajax_helper_test.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/actionpack/test/template/ajax_helper_test.rb b/actionpack/test/template/ajax_helper_test.rb
index 47d458e4ef..6d332d4fca 100644
--- a/actionpack/test/template/ajax_helper_test.rb
+++ b/actionpack/test/template/ajax_helper_test.rb
@@ -171,6 +171,13 @@ class AjaxHelperTest < AjaxHelperBaseTest
)
end
+ test "periodically_call_remote_with_function" do
+ assert_dom_equal(
+ "<script data-periodical=\"true\" data-url=\"http://www.example.com/\" type=\"application/json\" data-onobserve=\"alert('test')\" data-frequency=\"2\"></script>",
+ periodically_call_remote(:frequency => 2, :function => "alert('test')")
+ )
+ end
+
test "form_remote_tag" do
assert_dom_equal %(<form action=\"http://www.example.com/fast\" method=\"post\" data-remote=\"true\" data-update-success=\"glass_of_beer\">),
form_remote_tag(:update => "glass_of_beer", :url => { :action => :fast })
@@ -297,7 +304,7 @@ class AjaxHelperTest < AjaxHelperBaseTest
end
test "observe_field using function for callback" do
- assert_dom_equal %(<script data-observed=\"glass\" data-url=\"http://www.example.com/\" data-onobserve=\"function(element, value) {alert('Element changed')}\" data-observe=\"true\" type=\"application/json\" data-frequency=\"300\"></script>),
+ assert_dom_equal %(<script data-observed=\"glass\" data-url=\"http://www.example.com/\" data-observe=\"true\" type=\"application/json\" data-onobserve=\"alert('Element changed')\" data-frequency=\"300\"></script>),
observe_field("glass", :frequency => 5.minutes, :function => "alert('Element changed')")
end
@@ -307,7 +314,7 @@ class AjaxHelperTest < AjaxHelperBaseTest
end
test "observe_form using function for callback" do
- assert_dom_equal %(<script data-observed=\"cart\" data-url=\"http://www.example.com/\" data-onobserve=\"function(element, value) {alert('Form changed')}\" data-observe=\"true\" type=\"application/json\" data-frequency=\"2\"></script>),
+ assert_dom_equal %(<script data-observed=\"cart\" data-url=\"http://www.example.com/\" data-observe=\"true\" type=\"application/json\" data-onobserve=\"alert('Form changed')\" data-frequency=\"2\"></script>),
observe_form("cart", :frequency => 2, :function => "alert('Form changed')")
end