@@ -321,17 +321,11 @@ fn owner_change_via_change_owner_token() {
321
321
let body = json ! ( { "owners" : [ user2. gh_login] } ) ;
322
322
let body = serde_json:: to_vec ( & body) . unwrap ( ) ;
323
323
let response = token. put :: < ( ) > ( & url, & body) ;
324
- assert_eq ! ( response. status( ) , StatusCode :: FORBIDDEN ) ;
324
+ assert_eq ! ( response. status( ) , StatusCode :: OK ) ;
325
325
assert_eq ! (
326
326
response. into_json( ) ,
327
- json!( { "errors " : [ { "detail ": "must be logged in to perform that action" } ] } )
327
+ json!( { "ok " : true , "msg ": "user user-2 has been invited to be an owner of crate foo_crate" } )
328
328
) ;
329
- // TODO swap these assertions once token scopes are activated for this endpoint
330
- // assert_eq!(response.status(), StatusCode::OK);
331
- // assert_eq!(
332
- // response.into_json(),
333
- // json!({ "ok": true, "msg": "user user-2 has been invited to be an owner of crate foo_crate" })
334
- // );
335
329
}
336
330
337
331
#[ test]
@@ -350,17 +344,11 @@ fn owner_change_via_change_owner_token_with_matching_crate_scope() {
350
344
let body = json ! ( { "owners" : [ user2. gh_login] } ) ;
351
345
let body = serde_json:: to_vec ( & body) . unwrap ( ) ;
352
346
let response = token. put :: < ( ) > ( & url, & body) ;
353
- assert_eq ! ( response. status( ) , StatusCode :: FORBIDDEN ) ;
347
+ assert_eq ! ( response. status( ) , StatusCode :: OK ) ;
354
348
assert_eq ! (
355
349
response. into_json( ) ,
356
- json!( { "errors " : [ { "detail ": "must be logged in to perform that action" } ] } )
350
+ json!( { "ok " : true , "msg ": "user user-2 has been invited to be an owner of crate foo_crate" } )
357
351
) ;
358
- // TODO swap these assertions once token scopes are activated for this endpoint
359
- // assert_eq!(response.status(), StatusCode::OK);
360
- // assert_eq!(
361
- // response.into_json(),
362
- // json!({ "ok": true, "msg": "user user-2 has been invited to be an owner of crate foo_crate" })
363
- // );
364
352
}
365
353
366
354
#[ test]
0 commit comments