Update to Actix 4
Some checks failed
Core Repos/ImageApi/pipeline/pr-master There was a failure building this commit

This commit is contained in:
Cameron Cordes
2022-03-01 20:38:41 -05:00
parent 1e3f33c2d3
commit 69fe307516
8 changed files with 709 additions and 1074 deletions

View File

@@ -1,5 +1,8 @@
use actix_web::web::{self, HttpResponse, Json};
use actix_web::{post, Responder};
use actix_web::{
web::{self, Json},
HttpResponse,
};
use chrono::{Duration, Utc};
use jsonwebtoken::{encode, EncodingKey, Header};
use log::{debug, error};
@@ -57,6 +60,8 @@ pub async fn login(
#[cfg(test)]
mod tests {
use std::str::from_utf8;
use super::*;
use crate::testhelpers::{BodyReader, TestUserDao};
@@ -88,7 +93,9 @@ mod tests {
let response = login(j, web::Data::new(Box::new(dao))).await;
assert_eq!(response.status(), 200);
assert!(response.body().read_to_str().contains("\"token\""));
let response_text: String = response.read_to_str();
assert!(response_text.contains("\"token\""));
}
#[actix_rt::test]