@@ -270,10 +270,7 @@ fn test_github_login_does_not_overwrite_email() {
270
270
let mut req = req ( Method :: Get , "/api/v1/me" ) ;
271
271
let user = {
272
272
let conn = app. diesel_database . get ( ) . unwrap ( ) ;
273
- let user = NewUser {
274
- gh_id : 1 ,
275
- ..new_user ( "apricot" )
276
- } ;
273
+ let user = new_user ( "apricot" ) ;
277
274
278
275
let user = user. create_or_update ( & conn) . unwrap ( ) ;
279
276
sign_in_as ( & mut req, & user) ;
@@ -299,7 +296,7 @@ fn test_github_login_does_not_overwrite_email() {
299
296
{
300
297
let conn = app. diesel_database . get ( ) . unwrap ( ) ;
301
298
let user = NewUser {
302
- gh_id : 1 ,
299
+ gh_id : user . gh_id ,
303
300
..new_user ( "apricot" )
304
301
} ;
305
302
@@ -449,17 +446,17 @@ fn test_this_user_cannot_change_that_user_email() {
449
446
fn test_insert_into_email_table ( ) {
450
447
let ( _b, app, middle) = app ( ) ;
451
448
let mut req = req ( Method :: Get , "/me" ) ;
452
- {
449
+ let user = {
453
450
let conn = app. diesel_database . get ( ) . unwrap ( ) ;
454
451
let user = NewUser {
455
- gh_id : 1 ,
456
452
457
453
..new_user ( "apple" )
458
454
} ;
459
455
460
456
let user = user. create_or_update ( & conn) . unwrap ( ) ;
461
457
sign_in_as ( & mut req, & user) ;
462
- }
458
+ user
459
+ } ;
463
460
464
461
let mut response = ok_resp ! ( middle. call( req. with_path( "/api/v1/me" ) . with_method( Method :: Get ) , ) ) ;
465
462
let r = crate :: json :: < UserShowPrivateResponse > ( & mut response) ;
@@ -472,7 +469,7 @@ fn test_insert_into_email_table() {
472
469
{
473
470
let conn = app. diesel_database . get ( ) . unwrap ( ) ;
474
471
let user = NewUser {
475
- gh_id : 1 ,
472
+ gh_id : user . gh_id ,
476
473
477
474
..new_user ( "apple" )
478
475
} ;
@@ -499,7 +496,6 @@ fn test_insert_into_email_table_with_email_change() {
499
496
let user = {
500
497
let conn = app. diesel_database . get ( ) . unwrap ( ) ;
501
498
let user = NewUser {
502
- gh_id : 1 ,
503
499
504
500
..new_user ( "potato" )
505
501
} ;
@@ -531,7 +527,7 @@ fn test_insert_into_email_table_with_email_change() {
531
527
{
532
528
let conn = app. diesel_database . get ( ) . unwrap ( ) ;
533
529
let user = NewUser {
534
- gh_id : 1 ,
530
+ gh_id : user . gh_id ,
535
531
536
532
..new_user ( "potato" )
537
533
} ;
0 commit comments