https is now a valid url for people. thx grippi
This commit is contained in:
parent
9c2ca15e93
commit
a7b3fc48ec
2 changed files with 10 additions and 2 deletions
|
|
@ -148,10 +148,11 @@ class Person
|
|||
end
|
||||
|
||||
protected
|
||||
|
||||
def clean_url
|
||||
self.url ||= "http://localhost:3000/" if self.class == User
|
||||
if self.url
|
||||
self.url = 'http://' + self.url unless self.url.match('http://' || 'https://')
|
||||
self.url = 'http://' + self.url unless self.url.match(/https?:\/\//)
|
||||
self.url = self.url + '/' if self.url[-1, 1] != '/'
|
||||
end
|
||||
end
|
||||
|
|
@ -160,5 +161,4 @@ class Person
|
|||
def remove_all_traces
|
||||
Post.all(:person_id => id).each { |p| p.delete }
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -13,6 +13,14 @@ describe Person do
|
|||
@aspect2 = @user2.aspect(:name => "Abscence of Babes")
|
||||
end
|
||||
|
||||
describe "vaild url" do
|
||||
it 'should allow for https urls' do
|
||||
person = Factory.create(:person, :url => "https://example.com")
|
||||
person.valid?.should == true
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
describe '#diaspora_handle' do
|
||||
context 'local people' do
|
||||
it 'uses the pod config url to set the diaspora_handle' do
|
||||
|
|
|
|||
Loading…
Reference in a new issue