From 6caae0231c11ad89c1eeed3b0f8db8dfcb88c729 Mon Sep 17 00:00:00 2001
From: Riley Lynch <oss@teleological.net>
Date: Sat, 6 Oct 2012 16:58:27 -0400
Subject: 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.
---
 actionpack/test/template/url_helper_test.rb | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

(limited to 'actionpack/test')

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>",
-- 
cgit v1.2.3