(user: &User)
| 108 | } |
| 109 | |
| 110 | async fn register_new_user(user: &User) { |
| 111 | let client = reqwest::Client::new(); |
| 112 | let res = client |
| 113 | .post("http://localhost:3030/registration") |
| 114 | .json(&user) |
| 115 | .send() |
| 116 | .await |
| 117 | .unwrap() |
| 118 | .json::<Value>() |
| 119 | .await; |
| 120 | |
| 121 | assert_eq!(res.unwrap(), "Account added".to_string()); |
| 122 | |
| 123 | } |
| 124 | |
| 125 | async fn login(user: User) -> Token { |
| 126 | let client = reqwest::Client::new(); |