added testing module to the controllers
This commit is contained in:
parent
a8c247ccdd
commit
f66a16c34c
|
@ -3,3 +3,15 @@ use actix_web::{HttpRequest, Responder};
|
||||||
pub fn index(_req: &HttpRequest) -> impl Responder {
|
pub fn index(_req: &HttpRequest) -> impl Responder {
|
||||||
"Hello world!"
|
"Hello world!"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
use actix_web::{http, test};
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_index() {
|
||||||
|
let resp = test::TestRequest::default().run(&index).unwrap();
|
||||||
|
assert_eq!(resp.status(), http::StatusCode::OK);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue