@@ -514,11 +514,13 @@ fn test_confirm_user_email() {
514
514
515
515
// Simulate logging in via GitHub. Don't use app.db_new_user because it inserts a verified
516
516
// email directly into the database and we want to test the verification flow here.
517
+ let email = "cow@mammals@milk" ;
518
+
517
519
let user = app. db ( |conn| {
518
520
let u = NewUser {
519
521
..new_user ( "arbitrary_username" )
520
522
} ;
521
- let u = u. create_or_update ( None , conn) . unwrap ( ) ;
523
+ let u = u. create_or_update ( Some ( email ) , conn) . unwrap ( ) ;
522
524
MockCookieUser :: new ( & app, u)
523
525
} ) ;
524
526
let user_model = user. as_model ( ) ;
@@ -533,7 +535,7 @@ fn test_confirm_user_email() {
533
535
user. confirm_email ( & email_token) ;
534
536
535
537
let json = user. show_me ( ) ;
536
- assert_eq ! ( json. user. email. unwrap( ) , "potato2@example.com " ) ;
538
+ assert_eq ! ( json. user. email. unwrap( ) , "cow@mammals@milk " ) ;
537
539
assert ! ( json. user. email_verified) ;
538
540
assert ! ( json. user. email_verification_sent) ;
539
541
}
@@ -552,11 +554,12 @@ fn test_existing_user_email() {
552
554
553
555
// Simulate logging in via GitHub. Don't use app.db_new_user because it inserts a verified
554
556
// email directly into the database and we want to test the verification flow here.
557
+ let email = "potahto@example.com" ;
555
558
let user = app. db ( |conn| {
556
559
let u = NewUser {
557
560
..new_user ( "arbitrary_username" )
558
561
} ;
559
- let u = u. create_or_update ( None , conn) . unwrap ( ) ;
562
+ let u = u. create_or_update ( Some ( email ) , conn) . unwrap ( ) ;
560
563
update ( Email :: belonging_to ( & u) )
561
564
// Users created before we added verification will have
562
565
// `NULL` in the `token_generated_at` column.
0 commit comments