diff --git a/tests/e2e/web/api/v1/contexts/torrent/contract.rs b/tests/e2e/web/api/v1/contexts/torrent/contract.rs index c6dad2c3..1f5c20bc 100644 --- a/tests/e2e/web/api/v1/contexts/torrent/contract.rs +++ b/tests/e2e/web/api/v1/contexts/torrent/contract.rs @@ -1146,6 +1146,29 @@ mod for_authenticated_users { assert!(torrent_list_response.data.total > 0); assert!(response.is_json_and_ok()); } + + #[tokio::test] + async fn it_should_allow_registered_users_to_get_torrent_details_searching_by_info_hash() { + let mut env = TestEnv::new(); + env.start(api::Version::V1).await; + + if !env.provides_a_tracker() { + println!("test skipped. It requires a tracker to be running."); + return; + } + + let registered_user = new_logged_in_user(&env).await; + + let client = Client::authenticated(&env.server_socket_addr().unwrap(), ®istered_user.token); + + let uploader = new_logged_in_user(&env).await; + + let (test_torrent, _uploaded_torrent) = upload_random_torrent_to_index(&uploader, &env).await; + + let response = client.get_torrent(&test_torrent.file_info_hash()).await; + + assert_eq!(response.status, 200); + } } }