diff options
author | Kevin McPhillips <github@kevinmcphillips.ca> | 2015-04-06 22:20:57 -0400 |
---|---|---|
committer | Kevin McPhillips <github@kevinmcphillips.ca> | 2015-04-13 23:43:34 -0400 |
commit | 2b8acdcd21e61a69eefb5c3ef132995c287c0a8e (patch) | |
tree | a8ba1012769c9203eb176688ad8f59fb33686987 /actionpack/test | |
parent | efaec3dd63df113c7931f84d6b1d80f26307d93c (diff) | |
download | rails-2b8acdcd21e61a69eefb5c3ef132995c287c0a8e.tar.gz rails-2b8acdcd21e61a69eefb5c3ef132995c287c0a8e.tar.bz2 rails-2b8acdcd21e61a69eefb5c3ef132995c287c0a8e.zip |
Override default form builder for a controller
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/form_builder_test.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/actionpack/test/controller/form_builder_test.rb b/actionpack/test/controller/form_builder_test.rb new file mode 100644 index 0000000000..99eeaf9ab6 --- /dev/null +++ b/actionpack/test/controller/form_builder_test.rb @@ -0,0 +1,17 @@ +require 'abstract_unit' + +class FormBuilderController < ActionController::Base + class SpecializedFormBuilder < ActionView::Helpers::FormBuilder ; end + + default_form_builder SpecializedFormBuilder +end + +class ControllerFormBuilderTest < ActiveSupport::TestCase + setup do + @controller = FormBuilderController.new + end + + def test_default_form_builder_assigned + assert_equal FormBuilderController::SpecializedFormBuilder, @controller.default_form_builder + end +end |