From fd61535e11aca84cfd31fb01163bb2fc9222ad4c Mon Sep 17 00:00:00 2001
From: Raphael <raphael@joindiaspora.com>
Date: Thu, 9 Sep 2010 15:43:16 -0700
Subject: [PATCH] Hcards working

---
 app/models/person.rb       | 5 +----
 spec/lib/hcard.rb          | 3 +--
 spec/models/person_spec.rb | 1 -
 3 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/app/models/person.rb b/app/models/person.rb
index 82ee82e62f..e3a2dd5daa 100644
--- a/app/models/person.rb
+++ b/app/models/person.rb
@@ -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
diff --git a/spec/lib/hcard.rb b/spec/lib/hcard.rb
index 06a2371886..6092e4dab2 100644
--- a/spec/lib/hcard.rb
+++ b/spec/lib/hcard.rb
@@ -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
diff --git a/spec/models/person_spec.rb b/spec/models/person_spec.rb
index d2ce88049c..8f0e21ef99 100644
--- a/spec/models/person_spec.rb
+++ b/spec/models/person_spec.rb
@@ -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
     
-- 
GitLab