Skip to content

Commit

Permalink
test: new authorization test for guests getting torrent details searc…
Browse files Browse the repository at this point in the history
…hing by info hash
  • Loading branch information
mario-nt committed Oct 2, 2024
1 parent f1b6e7a commit d7b37fc
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/e2e/web/api/v1/contexts/torrent/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,26 @@ mod for_guests {
assert!(torrent_list_response.data.total > 0);
assert!(response.is_json_and_ok());
}

#[tokio::test]
async fn it_should_allow_guests_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 client = Client::unauthenticated(&env.server_socket_addr().unwrap());

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);
}
}
}

Expand Down

0 comments on commit d7b37fc

Please sign in to comment.