Skip to content

Commit d169e3d

Browse files
authored
tests/user: Simplify new_user() usage (#9878)
1 parent eb1cc80 commit d169e3d

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/tests/user.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,7 @@ async fn test_confirm_user_email() {
160160
// email directly into the database and we want to test the verification flow here.
161161
let email = "[email protected]";
162162

163-
let u = NewUser {
164-
..new_user("arbitrary_username")
165-
};
166-
let u = u
163+
let u = new_user("arbitrary_username")
167164
.create_or_update(Some(email), &app.as_inner().emails, &mut conn)
168165
.unwrap();
169166
let user = MockCookieUser::new(&app, u);
@@ -197,10 +194,7 @@ async fn test_existing_user_email() {
197194
// Simulate logging in via GitHub. Don't use app.db_new_user because it inserts a verified
198195
// email directly into the database and we want to test the verification flow here.
199196
let email = "[email protected]";
200-
let u = NewUser {
201-
..new_user("arbitrary_username")
202-
};
203-
let u = u
197+
let u = new_user("arbitrary_username")
204198
.create_or_update(Some(email), &app.as_inner().emails, &mut conn)
205199
.unwrap();
206200
update(Email::belonging_to(&u))

0 commit comments

Comments
 (0)