aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template
diff options
context:
space:
mode:
authordtaniwaki <daisuketaniwaki@gmail.com>2013-06-16 22:12:28 -0400
committerdtaniwaki <daisuketaniwaki@gmail.com>2013-06-16 22:28:49 -0400
commitc91e1cca4398aeb1e2d86b96f72b60e2b1b400ad (patch)
treecac8b61bdd8f68302636908222daa7cf060440b7 /actionpack/test/template
parenta84c40e19a7ad7db7b5ab1c29e20e698361a62cb (diff)
downloadrails-c91e1cca4398aeb1e2d86b96f72b60e2b1b400ad.tar.gz
rails-c91e1cca4398aeb1e2d86b96f72b60e2b1b400ad.tar.bz2
rails-c91e1cca4398aeb1e2d86b96f72b60e2b1b400ad.zip
Added test for link_to_unless to make sure the result consistency.
Diffstat (limited to 'actionpack/test/template')
-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 f63f235a5c..eb4349015a 100644
--- a/actionpack/test/template/url_helper_test.rb
+++ b/actionpack/test/template/url_helper_test.rb
@@ -348,6 +348,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