Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/helpers/form_builder_helpers.rb')
-rw-r--r--spec/support/helpers/form_builder_helpers.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/support/helpers/form_builder_helpers.rb b/spec/support/helpers/form_builder_helpers.rb
new file mode 100644
index 00000000000..4bae7421c4d
--- /dev/null
+++ b/spec/support/helpers/form_builder_helpers.rb
@@ -0,0 +1,13 @@
+# 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