X-Git-Url: http://these/git/?a=blobdiff_plain;f=crates%2Fdb_schema%2Fsrc%2Fimpls%2Ffederation_allowlist.rs;h=79efecc9a1ae890de989db602cd7e2df8a363c47;hb=3735c6fabfd85d6c98c2fc126b70e593db532eb8;hp=c0b4020ef159e63ef53918ec3a0537538ac9f106;hpb=47f4aa3550e7e79736f87673e007f930a9442f1f;p=lemmy.git diff --git a/crates/db_schema/src/impls/federation_allowlist.rs b/crates/db_schema/src/impls/federation_allowlist.rs index c0b4020e..79efecc9 100644 --- a/crates/db_schema/src/impls/federation_allowlist.rs +++ b/crates/db_schema/src/impls/federation_allowlist.rs @@ -59,25 +59,24 @@ mod tests { #[serial] async fn test_allowlist_insert_and_clear() { let pool = &build_db_pool_for_tests().await; - let allowed = Some(vec![ + let domains = vec![ "tld1.xyz".to_string(), "tld2.xyz".to_string(), "tld3.xyz".to_string(), - ]); + ]; + + let allowed = Some(domains.clone()); FederationAllowList::replace(pool, allowed).await.unwrap(); let allows = Instance::allowlist(pool).await.unwrap(); + let allows_domains = allows + .iter() + .map(|i| i.domain.clone()) + .collect::>(); assert_eq!(3, allows.len()); - assert_eq!( - vec![ - "tld1.xyz".to_string(), - "tld2.xyz".to_string(), - "tld3.xyz".to_string() - ], - allows - ); + assert_eq!(domains, allows_domains); // Now test clearing them via Some(empty vec) let clear_allows = Some(Vec::new());