diff options
author | Riley Lynch <oss@teleological.net> | 2012-10-06 16:58:27 -0400 |
---|---|---|
committer | Riley Lynch <oss@teleological.net> | 2012-10-06 17:14:10 -0400 |
commit | 6caae0231c11ad89c1eeed3b0f8db8dfcb88c729 (patch) | |
tree | b9fdc9f070eea770e7b4df24647764f2b25dfa0d /actionpack/test | |
parent | bcbf1bbba439346b9b16e9b3dbc417d4e3abb717 (diff) | |
download | rails-6caae0231c11ad89c1eeed3b0f8db8dfcb88c729.tar.gz rails-6caae0231c11ad89c1eeed3b0f8db8dfcb88c729.tar.bz2 rails-6caae0231c11ad89c1eeed3b0f8db8dfcb88c729.zip |
Accept :remote as symbol in link_to options
Accept either :remote or 'remote' in both the html_options and
(url_)options hash arguments to link_to.
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/url_helper_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb index 134177d74d..a969634e22 100644 --- a/actionpack/test/template/url_helper_test.rb +++ b/actionpack/test/template/url_helper_test.rb @@ -298,6 +298,20 @@ class UrlHelperTest < ActiveSupport::TestCase ) end + def test_link_to_with_symbolic_remote_in_non_html_options + assert_dom_equal( + "<a href=\"/\" data-remote=\"true\">Hello</a>", + link_to("Hello", hash_for(:remote => true), {}) + ) + end + + def test_link_to_with_string_remote_in_non_html_options + assert_dom_equal( + "<a href=\"/\" data-remote=\"true\">Hello</a>", + link_to("Hello", hash_for('remote' => true), {}) + ) + end + def test_link_tag_using_post_javascript assert_dom_equal( "<a href='http://www.example.com' data-method=\"post\" rel=\"nofollow\">Hello</a>", |