Commit 9a1b174 1 parent 50895ca commit 9a1b174 Copy full SHA for 9a1b174
File tree 1 file changed +33
-0
lines changed
tests/e2e/web/api/v1/contexts/torrent
1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -1577,6 +1577,39 @@ mod and_admins {
1577
1577
let new_title = format ! ( "{}-new-title" , test_torrent. index_info. title) ;
1578
1578
let new_description = format ! ( "{}-new-description" , test_torrent. index_info. description) ;
1579
1579
1580
+ let response = client
1581
+ . update_torrent (
1582
+ & test_torrent. file_info_hash ( ) ,
1583
+ UpdateTorrentFrom {
1584
+ title : Some ( new_title. clone ( ) ) ,
1585
+ description : Some ( new_description. clone ( ) ) ,
1586
+ category : None ,
1587
+ tags : None ,
1588
+ } ,
1589
+ )
1590
+ . await ;
1591
+
1592
+ assert_eq ! ( response. status, 200 ) ;
1593
+ }
1594
+ #[ tokio:: test]
1595
+ async fn it_should_allow_registered_users_to_update_their_own_torrents ( ) {
1596
+ let mut env = TestEnv :: new ( ) ;
1597
+ env. start ( api:: Version :: V1 ) . await ;
1598
+
1599
+ if !env. provides_a_tracker ( ) {
1600
+ println ! ( "test skipped. It requires a tracker to be running." ) ;
1601
+ return ;
1602
+ }
1603
+
1604
+ let admin = new_logged_in_admin ( & env) . await ;
1605
+
1606
+ let client = Client :: authenticated ( & env. server_socket_addr ( ) . unwrap ( ) , & admin. token ) ;
1607
+
1608
+ let ( test_torrent, _uploaded_torrent) = upload_random_torrent_to_index ( & admin, & env) . await ;
1609
+
1610
+ let new_title = format ! ( "{}-new-title" , test_torrent. index_info. title) ;
1611
+ let new_description = format ! ( "{}-new-description" , test_torrent. index_info. description) ;
1612
+
1580
1613
let response = client
1581
1614
. update_torrent (
1582
1615
& test_torrent. file_info_hash ( ) ,
You can’t perform that action at this time.
0 commit comments