gitlab-org--gitlab-foss/spec/support/helpers/test_request_helpers.rb
Thong Kuah 504cbb27c1 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
2018-10-15 11:09:10 +13:00

11 lines
312 B
Ruby

# 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