diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-10-31 16:42:43 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-10-31 16:42:43 -0200 |
commit | c1a118abc43453e98ba3be06e7f1fbc4afb06d4e (patch) | |
tree | bfb56c5b04a83e109193e7eb58d5e24f31b9eb0d /actionview/test | |
parent | ecb31131fb7c917baa9d53fde3021fb037861808 (diff) | |
parent | 0d6a56d63525c708e398eb99bb56eea18444d751 (diff) | |
download | rails-c1a118abc43453e98ba3be06e7f1fbc4afb06d4e.tar.gz rails-c1a118abc43453e98ba3be06e7f1fbc4afb06d4e.tar.bz2 rails-c1a118abc43453e98ba3be06e7f1fbc4afb06d4e.zip |
Merge branch 'tags-public-send'
Fixes #14180
Fixes #17461
Diffstat (limited to 'actionview/test')
-rw-r--r-- | actionview/test/template/form_helper_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/actionview/test/template/form_helper_test.rb b/actionview/test/template/form_helper_test.rb index f2238d1443..4bbbdf4fb1 100644 --- a/actionview/test/template/form_helper_test.rb +++ b/actionview/test/template/form_helper_test.rb @@ -1785,6 +1785,20 @@ class FormHelperTest < ActionView::TestCase assert_dom_equal expected, output_buffer end + def test_form_tags_do_not_call_private_properties_on_form_object + obj = Class.new do + private + + def private_property + raise "This method should not be called." + end + end.new + + form_for(obj, as: "other_name", url: '/', html: { id: "edit-other-name" }) do |f| + assert_raise(NoMethodError) { f.hidden_field(:private_property) } + end + end + def test_form_for_with_method_as_part_of_html_options form_for(@post, url: '/', html: { id: 'create-post', method: :delete }) do |f| concat f.text_field(:title) |