Hcards working
This commit is contained in:
parent
67f9d9dab5
commit
fd61535e11
3 changed files with 2 additions and 7 deletions
|
|
@ -97,15 +97,12 @@ class Person
|
|||
|
||||
new_person.email = identifier
|
||||
|
||||
puts profile.hcard.first[:href]
|
||||
|
||||
hcard = HCard.find profile.hcard.first[:href]
|
||||
|
||||
receive_url = profile.links.select{ |l| l.rel == 'http://joindiaspora.com/seed_location'}.first.href
|
||||
new_person.url = hcard[:url]
|
||||
puts new_person.url
|
||||
new_person.profile = Profile.new(:first_name => hcard[:given_name], :last_name => hcard[:family_name])
|
||||
if new_person.save!
|
||||
if new_person.save
|
||||
new_person
|
||||
else
|
||||
nil
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ describe HCard do
|
|||
hcard = HCard.find f.hcard.first[:href]
|
||||
hcard[:family_name].include?("Hamiltom").should be true
|
||||
hcard[:given_name].include?("Alex").should be true
|
||||
pp hcard
|
||||
(hcard[:url] == "http://tom.joindiaspora.com").should be true
|
||||
hcard[:url].should == "http://tom.joindiaspora.com/"
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -147,7 +147,6 @@ describe Person do
|
|||
|
||||
it 'should create a stub for a remote user' do
|
||||
tom = Person.by_webfinger('tom@tom.joindiaspora.com')
|
||||
puts tom.real_name
|
||||
tom.real_name.include?("Hamiltom").should be true
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue