aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-04-04 17:20:37 -0700
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-04-04 17:20:37 -0700
commitaa3b6837b250db0a0df4c9779e0370e55ef3eb7f (patch)
tree7c4f243869cbc28dffeb692896becda640fe4abe /actionpack/test
parent9e4c25e1b8108494b90ae33b578e64e6bfaac8e8 (diff)
parent4bb26dd7b298b08f53c7e157ddc19dc7febcf37e (diff)
downloadrails-aa3b6837b250db0a0df4c9779e0370e55ef3eb7f.tar.gz
rails-aa3b6837b250db0a0df4c9779e0370e55ef3eb7f.tar.bz2
rails-aa3b6837b250db0a0df4c9779e0370e55ef3eb7f.zip
Merge pull request #10065 from spohlenz/mail_to_block
Add block support for the mail_to helper
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/url_helper_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb
index 88c4b72ad7..e7b04d40c0 100644
--- a/actionpack/test/template/url_helper_test.rb
+++ b/actionpack/test/template/url_helper_test.rb
@@ -538,6 +538,16 @@ class UrlHelperTest < ActiveSupport::TestCase
assert mail_to("david@loudthinking.com").html_safe?
end
+ def test_mail_to_with_block
+ assert_dom_equal %{<a href="mailto:me@example.com"><span>Email me</span></a>},
+ mail_to('me@example.com') { content_tag(:span, 'Email me') }
+ end
+
+ def test_link_tag_with_block_and_options
+ assert_dom_equal %{<a class="special" href="mailto:me@example.com?cc=ccaddress%40example.com"><span>Email me</span></a>},
+ mail_to('me@example.com', cc: "ccaddress@example.com", class: "special") { content_tag(:span, 'Email me') }
+ end
+
def protect_against_forgery?
self.request_forgery
end