diff options
author | Mike Lewis <mlewis@gitlab.com> | 2019-03-07 15:59:00 +0000 |
---|---|---|
committer | Mike Lewis <mlewis@gitlab.com> | 2019-03-07 15:59:00 +0000 |
commit | dbd7309a16bd3abc6c586b6c2df2beb317cfef95 (patch) | |
tree | 3fdd719c926ac80285f0dc93ef975625657d0fbb /spec/support/webmock.rb | |
parent | 7be248334b350091e83d0335bf0c263071c6a67f (diff) | |
parent | b63efb09a5c864047924cd2d84527b47dd563d5f (diff) | |
download | gitlab-ce-reply-to-comment-documentation.tar.gz |
Merge branch 'master' into 'reply-to-comment-documentation'reply-to-comment-documentation
# Conflicts:
# doc/user/discussions/index.md
Diffstat (limited to 'spec/support/webmock.rb')
-rw-r--r-- | spec/support/webmock.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/support/webmock.rb b/spec/support/webmock.rb index af2906b7568..9ac7e7fc515 100644 --- a/spec/support/webmock.rb +++ b/spec/support/webmock.rb @@ -1,4 +1,12 @@ require 'webmock' require 'webmock/rspec' -WebMock.disable_net_connect!(allow_localhost: true) +def webmock_allowed_hosts + %w[elasticsearch registry.gitlab.com-gitlab-org-test-elastic-image].tap do |hosts| + if ENV.key?('ELASTIC_URL') + hosts << URI.parse(ENV['ELASTIC_URL']).host + end + end.uniq +end + +WebMock.disable_net_connect!(allow_localhost: true, allow: webmock_allowed_hosts) |