Skip to content

Commit

Permalink
fix: spelling mistake (#1048)
Browse files Browse the repository at this point in the history
fix: spelling mistake

Co-authored-by: anubis <anubis@users.noreply.github.com>
  • Loading branch information
lazyanubis and anubis authored Feb 6, 2025
1 parent 9bf6fe1 commit 27ca55f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions crates/core/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,51 +414,51 @@ mod tests {
res.render(Json(User { name: "jobs".into() }));
}
let router = Router::new().get(hello).push(Router::with_path("json").get(json));
let serivce = Service::new(router);
let service = Service::new(router);

let base_url = "http://127.0.0.1:5800";
let result = TestClient::get(base_url)
.send(&serivce)
.send(&service)
.await
.take_string()
.await
.unwrap();
assert_eq!(result, "Hello World");

let result = TestClient::get(format!("{}/json", base_url))
.send(&serivce)
.send(&service)
.await
.take_string()
.await
.unwrap();
assert_eq!(result, r#"{"name":"jobs"}"#);

let result = TestClient::get(format!("{}/not_exist", base_url))
.send(&serivce)
.send(&service)
.await
.take_string()
.await
.unwrap();
assert!(result.contains("Not Found"));
let result = TestClient::get(format!("{}/not_exist", base_url))
.add_header("accept", "application/json", true)
.send(&serivce)
.send(&service)
.await
.take_string()
.await
.unwrap();
assert!(result.contains(r#""code":404"#));
let result = TestClient::get(format!("{}/not_exist", base_url))
.add_header("accept", "text/plain", true)
.send(&serivce)
.send(&service)
.await
.take_string()
.await
.unwrap();
assert!(result.contains("code: 404"));
let result = TestClient::get(format!("{}/not_exist", base_url))
.add_header("accept", "application/xml", true)
.send(&serivce)
.send(&service)
.await
.take_string()
.await
Expand Down

0 comments on commit 27ca55f

Please sign in to comment.