mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
a9dc45459a
A few have been left for aesthetic reasons, but have made a pass and removed most of them. Note that if the method `foo` returns an array, `foo << 1` is a regular push, nothing to do with assignments, so no self required.
21 lines
605 B
Ruby
21 lines
605 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, default_form_builder
|
|
end
|
|
|
|
def test_assign_controller_skips_default_form_builder
|
|
@controller = OpenStruct.new
|
|
assign_controller(@controller)
|
|
|
|
assert_nil default_form_builder
|
|
end
|
|
end
|