Update to Actix 4
Some checks failed
Core Repos/ImageApi/pipeline/pr-master There was a failure building this commit
Some checks failed
Core Repos/ImageApi/pipeline/pr-master There was a failure building this commit
This commit is contained in:
11
src/auth.rs
11
src/auth.rs
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user