From a07cee62c7d23ec587ef961beb35ce3ac63df340 Mon Sep 17 00:00:00 2001 From: Jason Garber Date: Wed, 27 Apr 2011 21:00:27 -0600 Subject: Allow a label with the value option to have value-specific translations. --- actionpack/test/template/form_helper_test.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'actionpack/test/template') diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb index 7afab3179c..c25c850eb3 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -24,7 +24,10 @@ class FormHelperTest < ActionView::TestCase :helpers => { :label => { :post => { - :body => "Write entire text here" + :body => "Write entire text here", + :color => { + :red => "Rojo" + } } } } @@ -141,6 +144,13 @@ class FormHelperTest < ActionView::TestCase I18n.locale = old_locale end + def test_label_with_locales_and_value + old_locale, I18n.locale = I18n.locale, :label + assert_dom_equal('', label(:post, :color, :value => "red")) + ensure + I18n.locale = old_locale + end + def test_label_with_for_attribute_as_symbol assert_dom_equal('', label(:post, :title, nil, :for => "my_for")) end -- cgit v1.2.3