Improved fqdn detection with :port urls.

This commit is contained in:
Martin Edenhofer 2016-05-30 09:09:07 +02:00
parent 7a5f73c79a
commit f529def251
2 changed files with 32 additions and 2 deletions

View file

@ -147,7 +147,7 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
# split url in http_type and fqdn
settings = {}
if !Setting.get('system_online_service')
if params[:url] =~ %r{/^(http|https)://(.+?)$}
if params[:url] =~ %r{/^(http|https)://(.+?)(:.+?|/.+?|)$}
Setting.set('http_type', $1)
settings[:http_type] = $1
Setting.set('fqdn', $2)

View file

@ -167,6 +167,36 @@ class AaaGettingStartedTest < TestCase
url: '#clues',
#url: '#dashboard',
)
clues_close(
optional: false,
)
# verify organization and fqdn
click(
css: 'a[href="#manage"]',
)
click(
css: 'a[href="#settings/branding"]',
)
match(
css: '#content input[name="organization"]',
value: 'Some Organization',
)
click(
css: 'a[href="#settings/system"]',
)
fqdn = nil
if browser_url =~ %r{://(.+?)(:.+?|/.+?|)$}
fqdn = $1
end
raise "Unable to get fqdn based on #{browser_url}" if !fqdn
match(
css: '#content input[name="fqdn"]',
value: fqdn,
)
end
def test_b_accounts_auto