diff options
author | Thong Kuah <tkuah@gitlab.com> | 2018-10-10 21:45:49 +1300 |
---|---|---|
committer | Thong Kuah <tkuah@gitlab.com> | 2018-10-15 11:09:10 +1300 |
commit | 504cbb27c1018bd702346eb6497e37372dd9f35a (patch) | |
tree | a6af04b3348898bcaf916bca4f81c193b350c5ff /spec/support/helpers/test_request_helpers.rb | |
parent | cc1ccbf83a4a20f367011a6aec3d158214cfeb34 (diff) | |
download | gitlab-ce-504cbb27c1018bd702346eb6497e37372dd9f35a.tar.gz |
Remove un-used inheritance from service
Remove the inheritance from ::BaseService which is causing us to inherit
the initializer that has project as the first arg, as we will not have
access to project with forthcoming group clusters.
Also call install service from create service - 1 less thing to re-use
Extract TestRequest code into a spec helper. Given that we need
different behaviour for Rails 5.0 (and again in Rails 5.1!), it's handy
to have that branching behaviour in one place
Diffstat (limited to 'spec/support/helpers/test_request_helpers.rb')
-rw-r--r-- | spec/support/helpers/test_request_helpers.rb | 11 |
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 |