aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2008-05-12 23:54:21 -0700
committerPratik Naik <pratiknaik@gmail.com>2008-05-13 18:33:33 +0100
commitd16fbe53b202d52b5ef12526941ed50da2daf38f (patch)
treeff6233fa6cdef47d53d6b2cb6a4c4addf6c4e8ad /actionpack/test
parent3fee2378edd45188e41a7d14d4ca0a88280b541e (diff)
downloadrails-d16fbe53b202d52b5ef12526941ed50da2daf38f.tar.gz
rails-d16fbe53b202d52b5ef12526941ed50da2daf38f.tar.bz2
rails-d16fbe53b202d52b5ef12526941ed50da2daf38f.zip
Fix remote_function to escape apostrophes inside the remote url passed to Ajax.Update. [#180 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/prototype_helper_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/test/template/prototype_helper_test.rb b/actionpack/test/template/prototype_helper_test.rb
index a84d4e72af..9a1079b297 100644
--- a/actionpack/test/template/prototype_helper_test.rb
+++ b/actionpack/test/template/prototype_helper_test.rb
@@ -86,6 +86,11 @@ class PrototypeHelperTest < PrototypeHelperBaseTest
link_to_remote("Remote outauthor", { :url => { :action => "whatnot" }, :html => { :class => "fine" } })
end
+ def test_link_to_remote_url_quote_escaping
+ assert_dom_equal %(<a href="#" onclick="new Ajax.Request('http://www.example.com/whatnot\\\'s', {asynchronous:true, evalScripts:true}); return false;">Remote</a>),
+ link_to_remote("Remote", { :url => { :action => "whatnot's" } })
+ end
+
def test_periodically_call_remote
assert_dom_equal %(<script type="text/javascript">\n//<![CDATA[\nnew PeriodicalExecuter(function() {new Ajax.Updater('schremser_bier', 'http://www.example.com/mehr_bier', {asynchronous:true, evalScripts:true})}, 10)\n//]]>\n</script>),
periodically_call_remote(:update => "schremser_bier", :url => { :action => "mehr_bier" })