aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/form_helper_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/template/form_helper_test.rb')
-rw-r--r--actionpack/test/template/form_helper_test.rb20
1 files changed, 19 insertions, 1 deletions
diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb
index 454b6159ab..0c5c5d17ee 100644
--- a/actionpack/test/template/form_helper_test.rb
+++ b/actionpack/test/template/form_helper_test.rb
@@ -31,7 +31,10 @@ class FormHelperTest < ActionView::TestCase
:submit => {
:create => 'Create {{model}}',
:update => 'Confirm {{model}} changes',
- :submit => 'Save changes'
+ :submit => 'Save changes',
+ :another_post => {
+ :update => 'Update your {{model}}'
+ }
}
}
}
@@ -550,6 +553,21 @@ class FormHelperTest < ActionView::TestCase
I18n.locale = old_locale
end
+ def test_submit_with_object_and_nested_lookup
+ old_locale, I18n.locale = I18n.locale, :submit
+
+ form_for(:another_post, @post) do |f|
+ concat f.submit
+ end
+
+ expected = "<form action='http://www.example.com' method='post'>" +
+ "<input name='commit' id='another_post_submit' type='submit' value='Update your Post' />" +
+ "</form>"
+ assert_dom_equal expected, output_buffer
+ ensure
+ I18n.locale = old_locale
+ end
+
def test_nested_fields_for
form_for(:post, @post) do |f|
f.fields_for(:comment, @post) do |c|