aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/url_helper_test.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-06-17 10:01:03 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-06-24 16:15:56 -0300
commit2553bd785c0b41193257851ac0267515ec3c9dc3 (patch)
treec8bf6e9290c698d5d9e9c84ef74d66cecda2eee3 /actionpack/test/template/url_helper_test.rb
parent119f27c519d1fbfe47fa266fde50eec47ab56aaa (diff)
downloadrails-2553bd785c0b41193257851ac0267515ec3c9dc3.tar.gz
rails-2553bd785c0b41193257851ac0267515ec3c9dc3.tar.bz2
rails-2553bd785c0b41193257851ac0267515ec3c9dc3.zip
Merge pull request #10971 from dtaniwaki/escape_link_to_unless
Always escape the result of link_to_unless method
Diffstat (limited to 'actionpack/test/template/url_helper_test.rb')
-rw-r--r--actionpack/test/template/url_helper_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb
index 38f77203e0..a00d71ff29 100644
--- a/actionpack/test/template/url_helper_test.rb
+++ b/actionpack/test/template/url_helper_test.rb
@@ -306,6 +306,11 @@ class UrlHelperTest < ActiveSupport::TestCase
link_to_unless(true, "Showing", url_hash) {
"test"
}
+
+ assert_equal %{&lt;b&gt;Showing&lt;/b&gt;}, link_to_unless(true, "<b>Showing</b>", url_hash)
+ assert_equal %{<a href="/">&lt;b&gt;Showing&lt;/b&gt;</a>}, link_to_unless(false, "<b>Showing</b>", url_hash)
+ assert_equal %{<b>Showing</b>}, link_to_unless(true, "<b>Showing</b>".html_safe, url_hash)
+ assert_equal %{<a href="/"><b>Showing</b></a>}, link_to_unless(false, "<b>Showing</b>".html_safe, url_hash)
end
def test_link_to_if