File tree 1 file changed +24
-0
lines changed
tests/e2e/web/api/v1/contexts/torrent
1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -542,6 +542,30 @@ mod for_guests {
542
542
543
543
let response = client. get_torrent ( & test_torrent. file_info_hash ( ) ) . await ;
544
544
545
+ assert_eq ! ( response. status, 200 ) ;
546
+ }
547
+ #[ tokio:: test]
548
+ async fn it_should_allow_guests_to_get_torrent_details_searching_by_canonical_info_hash ( ) {
549
+ let mut env = TestEnv :: new ( ) ;
550
+ env. start ( api:: Version :: V1 ) . await ;
551
+
552
+ if !env. provides_a_tracker ( ) {
553
+ println ! ( "test skipped. It requires a tracker to be running." ) ;
554
+ return ;
555
+ }
556
+
557
+ let client = Client :: unauthenticated ( & env. server_socket_addr ( ) . unwrap ( ) ) ;
558
+
559
+ let uploader = new_logged_in_user ( & env) . await ;
560
+
561
+ let upload_client = Client :: authenticated ( & env. server_socket_addr ( ) . unwrap ( ) , & uploader. token ) ;
562
+
563
+ let test_torrent = random_torrent ( ) ;
564
+
565
+ let canonical_infohash = upload_test_torrent ( & upload_client, & test_torrent) . await . unwrap ( ) . to_string ( ) ;
566
+
567
+ let response = client. get_torrent ( & canonical_infohash) . await ;
568
+
545
569
assert_eq ! ( response. status, 200 ) ;
546
570
}
547
571
}
You can’t perform that action at this time.
0 commit comments