diff options
author | Sam Pohlenz <sam@sampohlenz.com> | 2013-04-03 14:42:48 +1030 |
---|---|---|
committer | Sam Pohlenz <sam@sampohlenz.com> | 2013-04-03 14:42:48 +1030 |
commit | 4bb26dd7b298b08f53c7e157ddc19dc7febcf37e (patch) | |
tree | 2715daf3f3bd8ae32e51555e467a43412a9f28af /actionpack/test/template/url_helper_test.rb | |
parent | 37683266d86db2b7c39cb32a1e39e3698f6a93a8 (diff) | |
download | rails-4bb26dd7b298b08f53c7e157ddc19dc7febcf37e.tar.gz rails-4bb26dd7b298b08f53c7e157ddc19dc7febcf37e.tar.bz2 rails-4bb26dd7b298b08f53c7e157ddc19dc7febcf37e.zip |
Add block support for the helper
Diffstat (limited to 'actionpack/test/template/url_helper_test.rb')
-rw-r--r-- | actionpack/test/template/url_helper_test.rb | 10 |
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 |