1
Fork 0
mirror of https://github.com/thegeneralist01/archivr synced 2026-07-22 03:05:32 +02:00

test(collections): update tag-search test to send auth (private entries require auth)

This commit is contained in:
TheGeneralist 2026-06-26 17:01:43 +02:00
parent 24c5321f6e
commit dd56fc8c70
Signed by: thegeneralist01
SSH key fingerprint: SHA256:pp9qddbCNmVNoSjevdvQvM5z0DHN7LTa8qBMbcMq/R4

View file

@ -1531,11 +1531,12 @@ mod tests {
.unwrap(); .unwrap();
assert_eq!(assign_resp.status(), StatusCode::CREATED, "assign tag should return 201"); assert_eq!(assign_resp.status(), StatusCode::CREATED, "assign tag should return 201");
// Search with ?tag=/science — entry should appear // Search with ?tag=/science — entry should appear (requires auth since entry is private)
let response = app(registry.clone(), auth_path.clone()) let response = app(registry.clone(), auth_path.clone())
.oneshot( .oneshot(
Request::builder() Request::builder()
.uri("/api/archives/test/entries/search?tag=%2Fscience") .uri("/api/archives/test/entries/search?tag=%2Fscience")
.header("cookie", &session_cookie)
.body(Body::empty()) .body(Body::empty())
.unwrap(), .unwrap(),
) )
@ -1555,6 +1556,7 @@ mod tests {
.oneshot( .oneshot(
Request::builder() Request::builder()
.uri("/api/archives/test/entries/search?tag=%2Fart") .uri("/api/archives/test/entries/search?tag=%2Fart")
.header("cookie", &session_cookie)
.body(Body::empty()) .body(Body::empty())
.unwrap(), .unwrap(),
) )