aboutsummaryrefslogtreecommitdiff
path: root/src/routes/not_understood.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/not_understood.rs')
-rw-r--r--src/routes/not_understood.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/routes/not_understood.rs b/src/routes/not_understood.rs
index 7ca5ed2..535fafe 100644
--- a/src/routes/not_understood.rs
+++ b/src/routes/not_understood.rs
@@ -1,7 +1,7 @@
use crate::routes::*;
// Sends a default response message when requested an undefined resource.
-pub fn not_understood(req: HttpRequest) -> JsonMessage<NotUnderstood> {
+pub async fn not_understood(req: HttpRequest) -> JsonMessage<NotUnderstood> {
let message = NotUnderstood {
path: destruct_path(req.path()),
};
@@ -17,14 +17,14 @@ mod tests {
use super::*;
use crate::routes::tests::*;
- #[test]
- fn test_not_understood() {
+ #[actix_rt::test]
+ async fn test_not_understood() {
// Arrange
let uri = "/api/phpmyadmin/index.rs";
let req = gen_request(uri, None);
// Act
- let result = not_understood(req);
+ let result = not_understood(req).await;
// Assert
assert!(result.is_ok());
@@ -34,14 +34,14 @@ mod tests {
assert_eq!(val.content.path, vec!["api", "phpmyadmin", "index.rs"]);
}
- #[test]
- fn test_not_understood_blank() {
+ #[actix_rt::test]
+ async fn test_not_understood_blank() {
// Arrange
let uri = "/";
let req = gen_request(uri, None);
// Act
- let result = not_understood(req);
+ let result = not_understood(req).await;
// Assert
assert!(result.is_ok());