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
factory :geo_node do
# Start at a number higher than the current port to avoid the GeoNode
# "lock out" validation
sequence(:url, Gitlab.config.gitlab.port + 1) do |port|
uri = URI.parse("http://#{Gitlab.config.gitlab.host}:#{Gitlab.config.gitlab.relative_url_root}")
uri.port = port
uri.path += '/' unless uri.path.end_with?('/')
sequence(:url) do |n|
"http://node#{n}.example.com/gitlab"
end
uri.to_s
sequence(:name) do |n|
"node_name_#{n}"
end
name { url }
primary false
trait :primary do
primary true
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
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