aboutsummaryrefslogtreecommitdiff
path: root/src/routes/not_understood.rs
diff options
context:
space:
mode:
authorKevin J Hoerr <kjhoerr@protonmail.com>2024-11-01 18:13:22 -0400
committerKevin Hoerr <kjhoerr@submelon.tech>2024-11-01 18:31:40 -0400
commitdd96c79d87ffe5b865c10ddef555157425d2858f (patch)
treedf095bda1573ee9ae8ab810a6705083d88acfbfb /src/routes/not_understood.rs
parent2888a678d27cef3e61ec9ab4d34d06fb92fc5ddc (diff)
downloadaugust-offensive-dd96c79d87ffe5b865c10ddef555157425d2858f.tar.gz
august-offensive-dd96c79d87ffe5b865c10ddef555157425d2858f.tar.bz2
august-offensive-dd96c79d87ffe5b865c10ddef555157425d2858f.zip
Update
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());