spec/ppl/adapter/vcard/vpim_spec.rb in ppl-0.3.0 vs spec/ppl/adapter/vcard/vpim_spec.rb in ppl-0.9.0
- old
+ new
@@ -20,10 +20,20 @@
it "should encode the contact's email address" do
@contact.email_address = "john@example.org"
@adapter.encode(@contact).should include("EMAIL:john@example.org")
end
+ it "should encode the contact's phone number" do
+ @contact.phone_number = "01234567890"
+ @adapter.encode(@contact).should include("TEL:01234567890")
+ end
+
+ it "should encode the contact's organization" do
+ @contact.organization = "Example Ltd"
+ @adapter.encode(@contact).should include("ORG:Example Ltd")
+ end
+
end
describe Ppl::Adapter::Vcard::Vpim, "#decode" do
@@ -74,9 +84,33 @@
"EMAIL;TYPE=home:home@example.org",
"END:VCARD",
].join("\n")
contact = @adapter.decode(vcard)
contact.email_address.should eq "home@example.org"
+ end
+
+ it "should decode the contact's phone number" do
+ vcard = [
+ "BEGIN:VCARD",
+ "N:,test",
+ "VERSION:3.0",
+ "TEL:01234567890",
+ "END:VCARD",
+ ].join("\n")
+ contact = @adapter.decode(vcard)
+ contact.phone_number.should eq "01234567890"
+ end
+
+ it "should decode the contact's organization" do
+ vcard = [
+ "BEGIN:VCARD",
+ "N:,test",
+ "VERSION:3.0",
+ "ORG:Example Ltd",
+ "END:VCARD",
+ ].join("\n")
+ contact = @adapter.decode(vcard)
+ contact.organization.should eq "Example Ltd"
end
end