Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Address PR review feedback (#448)
- assert the exact not_found body shape for both held and absent bounty
  ids in the mutation-gate helper, so a denial carrying lifecycle or
  participant detail fails the test
  • Loading branch information
beardthelion committed Sep 13, 2026
commit 9be99aa7a4a25999142d385ec58585fd09bd9124
24 changes: 18 additions & 6 deletions crates/gitlawb-node/src/test_support.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14825,19 +14825,31 @@ mod tests {
"{route} on a held private-repo bounty id must deny as 404, not a \
distinguishable status/participant error"
);
let msg = json_body(resp).await;
assert!(
msg["message"].as_str().unwrap_or("").contains("not found"),
"{route} denial body must be the not-found shape, got {msg}"
);
let held_body = json_body(resp).await;

// Absent id: the control case, already 404 today.
// Absent id: the control case. The body must carry the same not_found
// shape so a denial discloses nothing beyond the caller-supplied id.
let absent_uri = format!("/api/v1/bounties/b341-no-such-id/{route}");
let resp = router
.oneshot(signed_bounty_post(&stranger, &absent_uri, body))
.await
.unwrap();
assert_eq!(resp.status(), StatusCode::NOT_FOUND);
Comment thread
beardthelion marked this conversation as resolved.
Resolved
let absent_body = json_body(resp).await;

for (id, got) in [
("b341-held-id", &held_body),
("b341-no-such-id", &absent_body),
] {
assert_eq!(
*got,
serde_json::json!({
"error": "not_found",
"message": format!("bounty {id} not found"),
}),
"{route} denial body for {id} must be the bare not-found shape, got {got}"
);
}
}
Comment thread
beardthelion marked this conversation as resolved.
Resolved

#[sqlx::test]
Expand Down
Loading