mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-26 00:00:23 +02:00
Improve debug_handler on tuple response types (#2201)
Co-authored-by: David Pedersen <[email protected]> Co-authored-by: Jonas Platte <[email protected]>
This commit is contained in:
co-authored by
David Pedersen
Jonas Platte
parent
85573e0573
commit
d2cea5cdbd
+3
-1
@@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
# Unreleased
|
||||
|
||||
- None.
|
||||
- **fixed:** Improve `debug_handler` on tuple response types ([#2201])
|
||||
|
||||
[#2201]: https://github.com/tokio-rs/axum/pull/2201
|
||||
|
||||
# 0.7.3 (29. December, 2023)
|
||||
|
||||
|
||||
@@ -31,6 +31,18 @@ async fn nest() {
|
||||
assert_eq!(res.text().await, "fallback");
|
||||
}
|
||||
|
||||
#[crate::test]
|
||||
async fn two() {
|
||||
let app = Router::new()
|
||||
.route("/first", get(|| async {}))
|
||||
.route("/second", get(|| async {}))
|
||||
.fallback(get(|| async { "fallback" }));
|
||||
let client = TestClient::new(app);
|
||||
let res = client.get("/does-not-exist").await;
|
||||
assert_eq!(res.status(), StatusCode::OK);
|
||||
assert_eq!(res.text().await, "fallback");
|
||||
}
|
||||
|
||||
#[crate::test]
|
||||
async fn or() {
|
||||
let one = Router::new().route("/one", get(|| async {}));
|
||||
|
||||
Reference in New Issue
Block a user