refactor: single refusal shape with openapi contract test

This commit is contained in:
2026-10-25 21:55:38 +01:00
parent 816d39ffd6
commit c8d9138349
25 changed files with 764 additions and 273 deletions

View File

@@ -414,3 +414,23 @@ async fn openapi_paths_match_the_recorded_list() {
let expected = std::fs::read_to_string(&path).unwrap();
assert_eq!(actual, expected, "OpenAPI paths drifted from {fixture}");
}
#[cfg(feature = "federation")]
#[tokio::test]
async fn profile_page_serves_the_actor_document_to_activitypub_clients() {
let seed = seed().await;
let req = Request::builder()
.method(Method::GET)
.uri(format!("/users/{}", seed.user_id))
.header(header::ACCEPT, "application/activity+json")
.body(Body::empty())
.unwrap();
let (status, headers, body) = send(&seed.router, req).await;
assert_eq!(status, 200, "{body}");
assert_eq!(
headers.get(header::CONTENT_TYPE).unwrap(),
"application/activity+json"
);
let actor: serde_json::Value = serde_json::from_str(&body).expect("actor JSON");
assert_eq!(actor["type"], "Person");
}