spec/ppl/adapter/vcard/vpim_spec.rb in ppl-1.10.0 vs spec/ppl/adapter/vcard/vpim_spec.rb in ppl-1.11.0
- old
+ new
@@ -71,10 +71,15 @@
it "should encode the contact's URL" do
@contact.urls.push "http://google.com"
@adapter.encode(@contact).should include("URL:http://google.com")
end
+ it "should encode the contact's nickname" do
+ @contact.nicknames.push "Sleepy"
+ @adapter.encode(@contact).should include("NICKNAME:Sleepy")
+ end
+
end
describe Ppl::Adapter::Vcard::Vpim, "#decode" do
@@ -233,9 +238,21 @@
"URL:http://google.com",
"END:VCARD",
].join("\n")
contact = @adapter.decode(vcard)
contact.urls.first.should eq "http://google.com"
+ end
+
+ it "should decode the contact's nickame" do
+ vcard = [
+ "BEGIN:VCARD",
+ "N:,test",
+ "VERSION:3.0",
+ "NICKNAME:Happy;Cheerful",
+ "END:VCARD",
+ ].join("\n")
+ contact = @adapter.decode(vcard)
+ contact.nicknames.first.should eq "Happy"
end
end