aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorTobias Lütke <tobias.luetke@gmail.com>2005-10-13 17:39:14 +0000
committerTobias Lütke <tobias.luetke@gmail.com>2005-10-13 17:39:14 +0000
commitf60f76eab021c9dcfe3b67de3fd41288061f3065 (patch)
tree4057a95eddca7c21307cd054b0663eba655d792d /actionpack
parent24c3599cc0f9987d48f2f1c4fe85fc84a6be3d31 (diff)
downloadrails-f60f76eab021c9dcfe3b67de3fd41288061f3065.tar.gz
rails-f60f76eab021c9dcfe3b67de3fd41288061f3065.tar.bz2
rails-f60f76eab021c9dcfe3b67de3fd41288061f3065.zip
modified javascript_helper testcase to back up #2097
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2550 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/test/template/javascript_helper_test.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/actionpack/test/template/javascript_helper_test.rb b/actionpack/test/template/javascript_helper_test.rb
index 5967d29fc1..30528e1cc9 100644
--- a/actionpack/test/template/javascript_helper_test.rb
+++ b/actionpack/test/template/javascript_helper_test.rb
@@ -31,7 +31,7 @@ class JavaScriptHelperTest < Test::Unit::TestCase
def test_escape_javascript
assert_equal %(This \\"thing\\" is really\\n netos\\'), escape_javascript(%(This "thing" is really\n netos'))
end
-
+
def test_link_to_function
assert_dom_equal %(<a href="#" onclick="alert('Hello world!'); return false;">Greeting</a>),
link_to_function("Greeting", "alert('Hello world!')")
@@ -41,7 +41,11 @@ class JavaScriptHelperTest < Test::Unit::TestCase
assert_dom_equal %(<a class=\"fine\" href=\"#\" onclick=\"new Ajax.Request('http://www.example.com/whatnot', {asynchronous:true, evalScripts:true}); return false;\">Remote outpost</a>),
link_to_remote("Remote outpost", { :url => { :action => "whatnot" }}, { :class => "fine" })
assert_dom_equal %(<a href=\"#\" onclick=\"new Ajax.Request('http://www.example.com/whatnot', {asynchronous:true, evalScripts:true, onComplete:function(request){alert(request.reponseText)}}); return false;\">Remote outpost</a>),
- link_to_remote("Remote outpost", :complete => "alert(request.reponseText)", :url => { :action => "whatnot" })
+ link_to_remote("Remote outpost", :complete => "alert(request.reponseText)", :url => { :action => "whatnot" })
+ assert_dom_equal %(<a href=\"#\" onclick=\"new Ajax.Request('http://www.example.com/whatnot', {asynchronous:true, evalScripts:true, onSuccess:function(request){alert(request.reponseText)}}); return false;\">Remote outpost</a>),
+ link_to_remote("Remote outpost", :success => "alert(request.reponseText)", :url => { :action => "whatnot" })
+ assert_dom_equal %(<a href=\"#\" onclick=\"new Ajax.Request('http://www.example.com/whatnot', {asynchronous:true, evalScripts:true, onFailure:function(request){alert(request.reponseText)}}); return false;\">Remote outpost</a>),
+ link_to_remote("Remote outpost", :failure => "alert(request.reponseText)", :url => { :action => "whatnot" })
end
def test_periodically_call_remote