debian-mirror-gitlab/spec/support/helpers/form_builder_helpers.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
352 B
Ruby
Raw Normal View History

2022-07-23 23:45:48 +05:30
# 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