mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
add missing test for :with option to link_to_remote
This commit is contained in:
committed by
Stefan Penner
parent
9e3e1b3f24
commit
a5e9d033e8
@@ -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>),
|
||||
|
||||
Reference in New Issue
Block a user