summaryrefslogtreecommitdiff
path: root/spec/support/helpers/test_request_helpers.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/helpers/test_request_helpers.rb')
-rw-r--r--spec/support/helpers/test_request_helpers.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/support/helpers/test_request_helpers.rb b/spec/support/helpers/test_request_helpers.rb
new file mode 100644
index 00000000000..187a0e07891
--- /dev/null
+++ b/spec/support/helpers/test_request_helpers.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+module TestRequestHelpers
+ def test_request(remote_ip: '127.0.0.1')
+ if Gitlab.rails5?
+ ActionController::TestRequest.new({ remote_ip: remote_ip }, ActionController::TestSession.new)
+ else
+ ActionController::TestRequest.new(remote_ip: remote_ip)
+ end
+ end
+end