MS IZ removed a refrence to REDFINGER

This commit is contained in:
maxwell 2010-11-02 15:14:40 -07:00
parent a22060d1fb
commit 449a6f3ea0
2 changed files with 3 additions and 12 deletions

View file

@ -3,10 +3,6 @@
# the COPYRIGHT file.
module HCard
def self.fetch url
Nokogiri::HTML(Net::HTTP.get URI.parse(url))
end
def self.parse doc
{
:given_name => doc.css(".given_name").text,
@ -16,10 +12,6 @@ module HCard
}
end
def self.find url
self.parse self.fetch(url)
end
def self.build(raw_hcard)
self.parse Nokogiri::HTML(raw_hcard)
end

View file

@ -6,10 +6,9 @@ require 'spec_helper'
require File.join(Rails.root, 'lib/hcard')
describe HCard do
it 'should retreive and parse an hcard' do
stub_success("tom@tom.joindiaspora.com")
f = Redfinger.finger('tom@tom.joindiaspora.com')
hcard = HCard.find f.hcard.first[:href]
it 'should parse an hcard' do
raw_hcard = hcard_response
hcard = HCard.build raw_hcard
hcard[:family_name].include?("Hamiltom").should be true
hcard[:given_name].include?("Alex").should be true
hcard[:photo].include?("tom.jpg").should be true