diff options
author | dtaniwaki <daisuketaniwaki@gmail.com> | 2013-06-16 22:12:28 -0400 |
---|---|---|
committer | dtaniwaki <daisuketaniwaki@gmail.com> | 2013-06-16 22:28:49 -0400 |
commit | c91e1cca4398aeb1e2d86b96f72b60e2b1b400ad (patch) | |
tree | cac8b61bdd8f68302636908222daa7cf060440b7 /actionpack/test/template | |
parent | a84c40e19a7ad7db7b5ab1c29e20e698361a62cb (diff) | |
download | rails-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.rb | 5 |
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 %{<b>Showing</b>}, link_to_unless(true, "<b>Showing</b>", url_hash) + assert_equal %{<a href="/"><b>Showing</b></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 |