diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-11-03 17:43:30 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-11-03 17:43:30 -0200 |
commit | e37b470a6675a05df5a57455a3ac8c1c88ef04d6 (patch) | |
tree | 76118d342295aa601209f5bf602c0fbdee39a17d /actionview/test/template | |
parent | e670611e6002039231a24d547f9a6e053940fb16 (diff) | |
download | rails-e37b470a6675a05df5a57455a3ac8c1c88ef04d6.tar.gz rails-e37b470a6675a05df5a57455a3ac8c1c88ef04d6.tar.bz2 rails-e37b470a6675a05df5a57455a3ac8c1c88ef04d6.zip |
Add tests to make sure mail_to work with nil and SafeBuffer
Diffstat (limited to 'actionview/test/template')
-rw-r--r-- | actionview/test/template/url_helper_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/actionview/test/template/url_helper_test.rb b/actionview/test/template/url_helper_test.rb index 50b7865f88..43a65a58cb 100644 --- a/actionview/test/template/url_helper_test.rb +++ b/actionview/test/template/url_helper_test.rb @@ -523,6 +523,20 @@ class UrlHelperTest < ActiveSupport::TestCase mail_to('feedback@example.com', '<img src="/feedback.png" />'.html_safe) end + def test_mail_to_with_html_safe_string + assert_dom_equal( + %{<a href="mailto:david@loudthinking.com">david@loudthinking.com</a>}, + mail_to("david@loudthinking.com".html_safe) + ) + end + + def test_mail_to_with_nil + assert_dom_equal( + %{<a href="mailto:"></a>}, + mail_to(nil) + ) + end + def test_mail_to_returns_html_safe_string assert mail_to("david@loudthinking.com").html_safe? end |