diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-03-23 09:10:52 -0300 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-03-23 09:10:59 -0300 |
commit | 7a0cf2f5294e8bcef547642435636b394340a3e4 (patch) | |
tree | 88b7fb7d92fdd3f1f4e4d34973cf6f1acca5bf11 /actionpack/test/template | |
parent | d1887d384a4038d67bcad50a46a6dc67abfebe04 (diff) | |
download | rails-7a0cf2f5294e8bcef547642435636b394340a3e4.tar.gz rails-7a0cf2f5294e8bcef547642435636b394340a3e4.tar.bz2 rails-7a0cf2f5294e8bcef547642435636b394340a3e4.zip |
Properly deprecate the block argument in AV FormBuilder
Commit 56089ca986c767763f29159c8de0aa1ebabfd4d2 introduced a backward
incompatible change by changing the method signature of the FormBuilder.
This brings back the same method signature warning in case someone gives
a block to the builder.
More info: https://github.com/rails/rails/commit/56089ca986c767763f29159c8de0aa1ebabfd4d2#commitcomment-1116166
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/form_helper_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb index 2bdb54bd5e..17aeddc3ac 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -2223,6 +2223,18 @@ class FormHelperTest < ActionView::TestCase assert_equal "fields", output end + def test_form_builder_block_argument_deprecation + builder_class = Class.new(ActionView::Helpers::FormBuilder) do + def initialize(object_name, object, template, options, block) + super + end + end + + assert_deprecated /Giving a block to FormBuilder is deprecated and has no effect anymore/ do + builder_class.new(:foo, nil, nil, {}, proc {}) + end + end + protected def hidden_fields(method = nil) |