-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
59d690e
commit 9d2820f
Showing
4 changed files
with
29 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -177,6 +177,12 @@ impl Contact { | |
} | ||
} | ||
|
||
if let Some(urls) = &self.urls { | ||
for url in urls { | ||
vcard.push(json!(["url", {}, "uri", url])); | ||
} | ||
} | ||
|
||
// return the vcard array | ||
vec![Value::String("vcard".to_string()), Value::from(vcard)] | ||
} | ||
|
@@ -275,6 +281,7 @@ mod tests { | |
.contexts(vec!["work".to_string()]) | ||
.email("[email protected]") | ||
.build()]) | ||
.urls(vec!["https://example.com/some-url".to_string()]) | ||
.build(); | ||
|
||
// WHEN | ||
|
@@ -292,5 +299,6 @@ mod tests { | |
assert_eq!(contact.phones, actual.phones); | ||
assert_eq!(contact.emails, actual.emails); | ||
assert_eq!(contact.contact_uris, actual.contact_uris); | ||
assert_eq!(contact.urls, actual.urls); | ||
} | ||
} |