summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2018-10-15 13:55:20 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2018-10-15 13:55:20 +0000
commit076398d898e6f4cd7d3c3992de2444404f3a11d0 (patch)
treea0e7c96085464aa017c8cf52bb6ff04ab2df372f /spec/support
parent9bbad400a622f901f37c75fc639e0354c20a7f5c (diff)
parent504cbb27c1018bd702346eb6497e37372dd9f35a (diff)
downloadgitlab-ce-076398d898e6f4cd7d3c3992de2444404f3a11d0.tar.gz
Merge branch '34758-fix-code-reuse-clusters-applications_controller' into 'master'
Fix code reuse issue in Projects::Clusters::ApplicationController#index See merge request gitlab-org/gitlab-ce!22182
Diffstat (limited to 'spec/support')
-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