From fe79d4b5e22ae1612f6402d5350af7ade500807c Mon Sep 17 00:00:00 2001 From: Alexey Nayden Date: Mon, 24 Jan 2011 02:49:59 +0300 Subject: [PATCH 1/2] [6273] I18n labels for nested attributes test --- actionpack/test/template/form_helper_test.rb | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb index 2c60096..8764d16 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -24,6 +24,9 @@ class FormHelperTest < ActionView::TestCase :label => { :post => { :body => "Write entire text here" + }, + :"post[comments_attributes]" => { + :body => "Add your comment" } } } @@ -140,6 +143,13 @@ class FormHelperTest < ActionView::TestCase I18n.locale = old_locale end + def test_label_with_locales_and_nested_attributes + old_locale, I18n.locale = I18n.locale, :label + assert_dom_equal('', label("post[comments_attributes][3]", :body)) + 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 -- 1.7.3.5