Commit b5c7b4e6 authored by Michael Kozono's avatar Michael Kozono

Decouple GeoNode factory from config

Also, the port sequence did not seem to have any effect.
parent cf0693b4
FactoryBot.define do FactoryBot.define do
factory :geo_node do factory :geo_node do
# Start at a number higher than the current port to avoid the GeoNode sequence(:url) do |n|
# "lock out" validation "http://node#{n}.example.com/gitlab"
sequence(:url, Gitlab.config.gitlab.port + 1) do |port| end
uri = URI.parse("http://#{Gitlab.config.gitlab.host}:#{Gitlab.config.gitlab.relative_url_root}")
uri.port = port
uri.path += '/' unless uri.path.end_with?('/')
uri.to_s sequence(:name) do |n|
"node_name_#{n}"
end end
name { url }
primary false primary false
trait :primary do trait :primary do
primary true primary true
minimum_reverification_interval 7 minimum_reverification_interval 7
url do
uri = URI.parse("http://#{Gitlab.config.gitlab.host}:#{Gitlab.config.gitlab.relative_url_root}")
uri.port = Gitlab.config.gitlab.port
uri.path += '/' unless uri.path.end_with?('/')
uri.to_s
end
end end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment