diff options
author | Stephen St. Martin <kuprishuz@gmail.com> | 2010-01-24 13:21:35 -0500 |
---|---|---|
committer | Stefan Penner <stefan.penner@gmail.com> | 2010-01-27 12:44:33 -0600 |
commit | a5e9d033e81152e1b2280042ba6289c8a231e8bf (patch) | |
tree | c9ed253e5f8e0a88cc0741936516a69d52745209 /actionpack/test | |
parent | 9e3e1b3f24e2ba47f675ecbfc44c269323637985 (diff) | |
download | rails-a5e9d033e81152e1b2280042ba6289c8a231e8bf.tar.gz rails-a5e9d033e81152e1b2280042ba6289c8a231e8bf.tar.bz2 rails-a5e9d033e81152e1b2280042ba6289c8a231e8bf.zip |
add missing test for :with option to link_to_remote
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/ajax_helper_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/test/template/ajax_helper_test.rb b/actionpack/test/template/ajax_helper_test.rb index 4d76007d52..6fa8a95d42 100644 --- a/actionpack/test/template/ajax_helper_test.rb +++ b/actionpack/test/template/ajax_helper_test.rb @@ -90,6 +90,12 @@ class AjaxHelperTest < AjaxHelperBaseTest assert_dom_equal %(<a href=\"#\" data-remote=\"true\" data-url=\"http://www.example.com/whatnot\" data-onbefore=\"before();\" data-onafter=\"after();\">Remote outauthor</a>), link_to_remote("Remote outauthor", :url => { :action => "whatnot" }, :before => "before();", :after => "after();") end + + test "link_to_remote using :with expression" do + expected = %(<a href=\"#\" data-remote=\"true\" data-url=\"http://www.example.com/whatnot\" data-with=\"'id=' + encodeURIComponent(value)\">Remote outauthor</a>) + assert_dom_equal expected, link_to_remote("Remote outauthor", :url => { :action => "whatnot" }, :with => "id") + assert_dom_equal expected, link_to_remote("Remote outauthor", :url => { :action => "whatnot" }, :with => "'id=' + encodeURIComponent(value)") + end test "link_to_remote with method delete" do assert_dom_equal %(<a class=\"fine\" href=\"#\" data-remote=\"true\" data-url=\"http://www.example.com/whatnot\" data-method=\"delete\" rel=\"nofollow\">Remote outauthor</a>), |