Backport stub_default_url_options from EE

Used in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/5782
This commit is contained in:
James Edwards-Jones 2018-12-03 13:33:00 +00:00
parent 8cd5004b35
commit d4f2978734
1 changed files with 5 additions and 0 deletions

View File

@ -27,6 +27,11 @@ module StubConfiguration
allow(Gitlab.config.gitlab).to receive_messages(to_settings(messages))
end
def stub_default_url_options(host: "localhost", protocol: "http")
url_options = { host: host, protocol: protocol }
allow(Rails.application.routes).to receive(:default_url_options).and_return(url_options)
end
def stub_gravatar_setting(messages)
allow(Gitlab.config.gravatar).to receive_messages(to_settings(messages))
end