Extract EE specific files/lines for unicorn spec
We have the following files containing EE specific code. We should move them to ee/
spec/support/webmock.rb
diff --git a/spec/support/webmock.rb b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/spec/support/webmock.rb
index af2906b7568..90372c68529 100644
--- a/spec/support/webmock.rb
+++ b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/spec/support/webmock.rb
@@ -1,4 +1,16 @@
require 'webmock'
require 'webmock/rspec'
-WebMock.disable_net_connect!(allow_localhost: true)
+def webmock_setup_defaults
+ allowed = %w[elasticsearch registry.gitlab.com-gitlab-org-test-elastic-image]
+
+ if ENV.key?('ELASTIC_URL')
+ url = URI.parse(ENV['ELASTIC_URL'])
+ allowed << url.host
+ allowed.uniq!
+ end
+
+ WebMock.disable_net_connect!(allow_localhost: true, allow: allowed)
+end
+
+webmock_setup_defaults
Edited by Yorick Peterse