From e37b470a6675a05df5a57455a3ac8c1c88ef04d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Tue, 3 Nov 2015 17:43:30 -0200 Subject: Add tests to make sure mail_to work with nil and SafeBuffer --- actionview/test/template/url_helper_test.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'actionview/test') 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', ''.html_safe) end + def test_mail_to_with_html_safe_string + assert_dom_equal( + %{david@loudthinking.com}, + mail_to("david@loudthinking.com".html_safe) + ) + end + + def test_mail_to_with_nil + assert_dom_equal( + %{}, + mail_to(nil) + ) + end + def test_mail_to_returns_html_safe_string assert mail_to("david@loudthinking.com").html_safe? end -- cgit v1.2.3