1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionview/test/template/controller_helper_test.rb
2015-04-13 23:43:34 -04:00

21 lines
615 B
Ruby

require 'abstract_unit'
class ControllerHelperTest < ActionView::TestCase
tests ActionView::Helpers::ControllerHelper
class SpecializedFormBuilder < ActionView::Helpers::FormBuilder ; end
def test_assign_controller_sets_default_form_builder
@controller = OpenStruct.new(default_form_builder: SpecializedFormBuilder)
assign_controller(@controller)
assert_equal SpecializedFormBuilder, self.default_form_builder
end
def test_assign_controller_skips_default_form_builder
@controller = OpenStruct.new
assign_controller(@controller)
assert_nil self.default_form_builder
end
end