aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test
diff options
context:
space:
mode:
authorJeremy Kemper <jeremykemper@gmail.com>2014-08-25 07:22:17 -0700
committerJeremy Kemper <jeremykemper@gmail.com>2014-08-25 07:22:17 -0700
commit0b7edd4418bcca97d517070d8578684a11897b8f (patch)
tree993747dfd5374c3f7e804e51b3b5b4e50c2bdd08 /actionview/test
parent3fe54b3a058509a52bc55bbf1c8bbc308c596891 (diff)
parentce8e4a43b353b7e36a1c9f98561dc7ed23e16c93 (diff)
downloadrails-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')
-rw-r--r--actionview/test/template/form_helper_test.rb9
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>},