summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorD. Scott Boggs <scott@tams.tech>2023-02-12 12:59:00 -0500
committerD. Scott Boggs <scott@tams.tech>2024-04-08 08:56:16 -0400
commitd6151286f1f0fe27e26ab2950ea61ac592eedadd (patch)
tree150b6f83cc81d062bfa2de532570e5b22e469ff1
parentd2165d80cca80577089c5f6b23032470a8bb1206 (diff)
Add Admin::DomainAllow test example
-rw-r--r--entities/src/admin/domain.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/entities/src/admin/domain.rs b/entities/src/admin/domain.rs
index c393102..3734a7e 100644
--- a/entities/src/admin/domain.rs
+++ b/entities/src/admin/domain.rs
@@ -82,4 +82,16 @@ mod tests {
assert!(subject.public_comment.is_none());
assert!(!subject.obfuscate);
}
-} \ No newline at end of file
+
+ #[test]
+ fn test_domain_allow_example() {
+ let example = r#"{
+ "id": "1",
+ "domain": "mastodon.social",
+ "created_at": "2022-09-14T21:23:02.755Z"
+ }"#;
+ let subject: Allow = serde_json::from_str(example).unwrap();
+ assert_eq!(subject.id, AllowDomainId::new("1"));
+ assert_eq!(subject.domain, "mastodon.social");
+ }
+}