spec/ppl/adapter/vcard/vpim_spec.rb in ppl-1.7.0 vs spec/ppl/adapter/vcard/vpim_spec.rb in ppl-1.8.0
- old
+ new
@@ -66,10 +66,15 @@
@contact.postal_address = Ppl::Entity::PostalAddress.new
@contact.postal_address.region = "South West"
@adapter.encode(@contact).should include("ADR:;;;;South West;;")
end
+ it "should encode the contact's URL" do
+ @contact.urls.push "http://google.com"
+ @adapter.encode(@contact).should include("URL:http://google.com")
+ end
+
end
describe Ppl::Adapter::Vcard::Vpim, "#decode" do
@@ -216,9 +221,21 @@
"ADR:;;;;;;UK",
"END:VCARD",
].join("\n")
contact = @adapter.decode(vcard)
contact.postal_address.country.should eq "UK"
+ end
+
+ it "should decode the contact's URL" do
+ vcard = [
+ "BEGIN:VCARD",
+ "N:,test",
+ "VERSION:3.0",
+ "URL:http://google.com",
+ "END:VCARD",
+ ].join("\n")
+ contact = @adapter.decode(vcard)
+ contact.urls.first.should eq "http://google.com"
end
end