debian-mirror-gitlab/spec/support/helpers/form_builder_helpers.rb
2022-07-29 14:03:07 +02:00

13 lines
352 B
Ruby

# frozen_string_literal: true
module FormBuilderHelpers
def fake_action_view_base
lookup_context = ActionView::LookupContext.new(ActionController::Base.view_paths)
ActionView::Base.new(lookup_context, {}, ApplicationController.new)
end
def fake_form_for(&block)
fake_action_view_base.form_for :user, url: '/user', &block
end
end