diff options
author | Grant Hutchins & Peter Jaros <pair+grant+pjaros@pivotallabs.com> | 2011-07-08 17:54:15 -0400 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-08-13 16:22:21 -0700 |
commit | 6e671a8536f17b6f23b5251652015ce8c1557f1f (patch) | |
tree | 98177efb062b64203d0b33122515fd7b72909392 /actionpack/test/template/form_helper_test.rb | |
parent | a636a9358e184bd1a3e2d2522584247be7045cdf (diff) | |
download | rails-6e671a8536f17b6f23b5251652015ce8c1557f1f.tar.gz rails-6e671a8536f17b6f23b5251652015ce8c1557f1f.tar.bz2 rails-6e671a8536f17b6f23b5251652015ce8c1557f1f.zip |
Let ActiveModel instances define partial paths.
Deprecate ActiveModel::Name#partial_path. Now you
should call #to_path directly on ActiveModel
instances.
Diffstat (limited to 'actionpack/test/template/form_helper_test.rb')
-rw-r--r-- | actionpack/test/template/form_helper_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb index aca2dc9e4d..71a2c46d92 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -1891,6 +1891,17 @@ class FormHelperTest < ActionView::TestCase assert_equal LabelledFormBuilder, klass end + def test_form_for_with_labelled_builder_path + path = nil + + form_for(@post, :builder => LabelledFormBuilder) do |f| + path = f.to_path + '' + end + + assert_equal 'labelled_form', path + end + class LabelledFormBuilderSubclass < LabelledFormBuilder; end def test_form_for_with_labelled_builder_with_nested_fields_for_with_custom_builder |