File tree 1 file changed +22
-0
lines changed
tests/e2e/web/api/v1/contexts/torrent
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -473,6 +473,28 @@ mod for_guests {
473
473
474
474
assert_eq ! ( response. status, 401 ) ;
475
475
}
476
+
477
+ #[ tokio:: test]
478
+ async fn it_should_allow_guests_to_download_a_torrent_file_searching_by_info_hash ( ) {
479
+ let mut env = TestEnv :: new ( ) ;
480
+ env. start ( api:: Version :: V1 ) . await ;
481
+
482
+ if !env. provides_a_tracker ( ) {
483
+ println ! ( "test skipped. It requires a tracker to be running." ) ;
484
+ return ;
485
+ }
486
+
487
+ let client = Client :: unauthenticated ( & env. server_socket_addr ( ) . unwrap ( ) ) ;
488
+ let uploader = new_logged_in_user ( & env) . await ;
489
+
490
+ // Upload
491
+ let ( test_torrent, _torrent_listed_in_index) = upload_random_torrent_to_index ( & uploader, & env) . await ;
492
+
493
+ // Download
494
+ let response = client. download_torrent ( & test_torrent. file_info_hash ( ) ) . await ;
495
+
496
+ assert_eq ! ( response. status, 200 ) ;
497
+ }
476
498
}
477
499
}
478
500
You can’t perform that action at this time.
0 commit comments