@@ -367,17 +367,11 @@ fn owner_change_via_change_owner_token_with_wrong_crate_scope() {
367
367
let body = json ! ( { "owners" : [ user2. gh_login] } ) ;
368
368
let body = serde_json:: to_vec ( & body) . unwrap ( ) ;
369
369
let response = token. put :: < ( ) > ( & url, & body) ;
370
- assert_eq ! ( response. status( ) , StatusCode :: OK ) ;
370
+ assert_eq ! ( response. status( ) , StatusCode :: FORBIDDEN ) ;
371
371
assert_eq ! (
372
372
response. into_json( ) ,
373
- json!( { "ok " : true , "msg ": "user user-2 has been invited to be an owner of crate foo_crate" } )
373
+ json!( { "errors " : [ { "detail ": "must be logged in to perform that action" } ] } )
374
374
) ;
375
- // TODO this should return "403 Forbidden" once token scopes are implemented for this endpoint
376
- // assert_eq!(response.status(), StatusCode::FORBIDDEN);
377
- // assert_eq!(
378
- // response.into_json(),
379
- // json!({ "errors": [{ "detail": "must be logged in to perform that action" }] })
380
- // );
381
375
}
382
376
383
377
#[ test]
@@ -395,17 +389,11 @@ fn owner_change_via_publish_token() {
395
389
let body = json ! ( { "owners" : [ user2. gh_login] } ) ;
396
390
let body = serde_json:: to_vec ( & body) . unwrap ( ) ;
397
391
let response = token. put :: < ( ) > ( & url, & body) ;
398
- assert_eq ! ( response. status( ) , StatusCode :: OK ) ;
392
+ assert_eq ! ( response. status( ) , StatusCode :: FORBIDDEN ) ;
399
393
assert_eq ! (
400
394
response. into_json( ) ,
401
- json!( { "ok " : true , "msg ": "user user-2 has been invited to be an owner of crate foo_crate" } )
395
+ json!( { "errors " : [ { "detail ": "must be logged in to perform that action" } ] } )
402
396
) ;
403
- // TODO this should return "403 Forbidden" once token scopes are implemented for this endpoint
404
- // assert_eq!(response.status(), StatusCode::FORBIDDEN);
405
- // assert_eq!(
406
- // response.into_json(),
407
- // json!({ "errors": [{ "detail": "must be logged in to perform that action" }] })
408
- // );
409
397
}
410
398
411
399
#[ test]
0 commit comments