diff options
author | Jeremy Kemper <jeremykemper@gmail.com> | 2014-08-25 07:22:17 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremykemper@gmail.com> | 2014-08-25 07:22:17 -0700 |
commit | 0b7edd4418bcca97d517070d8578684a11897b8f (patch) | |
tree | 993747dfd5374c3f7e804e51b3b5b4e50c2bdd08 /actionview/test/template | |
parent | 3fe54b3a058509a52bc55bbf1c8bbc308c596891 (diff) | |
parent | ce8e4a43b353b7e36a1c9f98561dc7ed23e16c93 (diff) | |
download | rails-0b7edd4418bcca97d517070d8578684a11897b8f.tar.gz rails-0b7edd4418bcca97d517070d8578684a11897b8f.tar.bz2 rails-0b7edd4418bcca97d517070d8578684a11897b8f.zip |
Merge pull request #16488 from agrobbin/form-label-builder
Provide a builder for form labels to customize wrapping around I18n content
Diffstat (limited to 'actionview/test/template')
-rw-r--r-- | actionview/test/template/form_helper_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/actionview/test/template/form_helper_test.rb b/actionview/test/template/form_helper_test.rb index 6910769183..6f82462425 100644 --- a/actionview/test/template/form_helper_test.rb +++ b/actionview/test/template/form_helper_test.rb @@ -319,6 +319,15 @@ class FormHelperTest < ActionView::TestCase ) end + def test_label_with_block_and_builder + with_locale :label do + assert_dom_equal( + '<label for="post_body"><b>Write entire text here</b></label>', + label(:post, :body) { |b| "<b>#{b.translation}</b>".html_safe } + ) + end + end + def test_label_with_block_in_erb assert_equal( %{<label for="post_message">\n Message\n <input id="post_message" name="post[message]" type="text" />\n</label>}, |