Adds a new APP_CONFIG[:pod_uri] item, an uri object parsed from pod_url. Replace all occurrences of APP_CONFIG[:terse_pod_url] with APP_CONFIG[:pod_uri].host. Closes http://bugs.joindiaspora.com/issues/684, using the well-defined semantics of the uri object. The pod_url is normalized using module URI's functions, always with a trailing /. The diaspora-handle will always reflect the pod_url with this patch i. e., a pod_url like www.dpod.se will give the handle xx@www.dpod.se; previous code stripped the www. prefix. If this is a problem, it should be addressed by another setting, since one cannot presume that www.domain.tld resolves to the same address as domain.tld.
17 lines
490 B
Ruby
17 lines
490 B
Ruby
# Copyright (c) 2010, Diaspora Inc. This file is
|
|
# licensed under the Affero General Public License version 3 or later. See
|
|
# the COPYRIGHT file.
|
|
|
|
describe 'making sure the config is parsed as should' do
|
|
|
|
describe 'pod_url' do
|
|
it 'should have a trailing slash' do
|
|
APP_CONFIG[:pod_url].should == 'http://example.org/'
|
|
end
|
|
end
|
|
|
|
describe 'terse_pod_url'
|
|
it 'should be correctly parsed' do
|
|
APP_CONFIG[:pod_uri].host.should == 'example.org'
|
|
end
|
|
end
|