diff options
author | Alex Robbin <alex.robbin@meyouhealth.com> | 2014-08-12 23:43:24 -0400 |
---|---|---|
committer | Alex Robbin <alex.robbin@meyouhealth.com> | 2014-08-20 09:59:28 -0400 |
commit | ce8e4a43b353b7e36a1c9f98561dc7ed23e16c93 (patch) | |
tree | 8ac5afab1cf08cd01d54431b18ace87e4aed3e16 /actionview/test | |
parent | b6f5b48b4063eaaea0a823ca08c8fd270128ab42 (diff) | |
download | rails-ce8e4a43b353b7e36a1c9f98561dc7ed23e16c93.tar.gz rails-ce8e4a43b353b7e36a1c9f98561dc7ed23e16c93.tar.bz2 rails-ce8e4a43b353b7e36a1c9f98561dc7ed23e16c93.zip |
provide a builder for form labels to customize wrapping around I18n content
Diffstat (limited to 'actionview/test')
-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 d944214961..4cb2abbd85 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>}, |