Skip to content

Commit d7b37fc

Browse files
committed
test: new authorization test for guests getting torrent details searching by info hash
1 parent f1b6e7a commit d7b37fc

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/e2e/web/api/v1/contexts/torrent/contract.rs

+20
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,26 @@ mod for_guests {
524524
assert!(torrent_list_response.data.total > 0);
525525
assert!(response.is_json_and_ok());
526526
}
527+
528+
#[tokio::test]
529+
async fn it_should_allow_guests_to_get_torrent_details_searching_by_info_hash() {
530+
let mut env = TestEnv::new();
531+
env.start(api::Version::V1).await;
532+
533+
if !env.provides_a_tracker() {
534+
println!("test skipped. It requires a tracker to be running.");
535+
return;
536+
}
537+
538+
let client = Client::unauthenticated(&env.server_socket_addr().unwrap());
539+
540+
let uploader = new_logged_in_user(&env).await;
541+
let (test_torrent, _uploaded_torrent) = upload_random_torrent_to_index(&uploader, &env).await;
542+
543+
let response = client.get_torrent(&test_torrent.file_info_hash()).await;
544+
545+
assert_eq!(response.status, 200);
546+
}
527547
}
528548
}
529549

0 commit comments

Comments
 (0)