Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Edwards-Jones <jedwardsjones@gitlab.com>2018-12-03 16:33:00 +0300
committerJames Edwards-Jones <jedwardsjones@gitlab.com>2018-12-03 19:12:13 +0300
commitd4f29787345a44f3e0e3d6bd97a889b1565c69ce (patch)
tree98718e2f96bda053ae168b6510df2ff42e7eb774 /spec/support/helpers
parent8cd5004b350ef342f66956c11272dad1328f6526 (diff)
Backport stub_default_url_options from EE
Used in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/5782
Diffstat (limited to 'spec/support/helpers')
-rw-r--r--spec/support/helpers/stub_configuration.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/support/helpers/stub_configuration.rb b/spec/support/helpers/stub_configuration.rb
index 776119564ec..2851cd9733c 100644
--- a/spec/support/helpers/stub_configuration.rb
+++ b/spec/support/helpers/stub_configuration.rb
@@ -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