diff options
author | Ali MJ Al-Nasrawy <alimjalnasrawy@gmail.com> | 2022-02-06 10:12:19 +0000 |
---|---|---|
committer | Ali MJ Al-Nasrawy <alimjalnasrawy@gmail.com> | 2022-02-06 10:12:19 +0000 |
commit | 8e0930cc9f25e44a69f61763ac5ff38ba58bb3dd (patch) | |
tree | e9500f4d2180984fe7981205c44ac89048f1019c /tests/serve_request.rs | |
parent | Merge pull request #725 from aliemjay/update_actix_web (diff) | |
parent | Apply alimjays suggestion (diff) | |
download | miniserve-8e0930cc9f25e44a69f61763ac5ff38ba58bb3dd.tar.gz miniserve-8e0930cc9f25e44a69f61763ac5ff38ba58bb3dd.zip |
Merge 'jikstra/feat_route_prefix' #682
Diffstat (limited to 'tests/serve_request.rs')
-rw-r--r-- | tests/serve_request.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/serve_request.rs b/tests/serve_request.rs index ec2c978..1491be9 100644 --- a/tests/serve_request.rs +++ b/tests/serve_request.rs @@ -260,3 +260,18 @@ fn serve_index_instead_of_404_in_spa_mode( Ok(()) } + +#[rstest] +fn serves_requests_with_path_prefix( + #[with(["--route-prefix", "foobar"])] server: TestServer, +) -> Result<(), Error> { + let url_without_route = server.url(); + let status = reqwest::blocking::get(url_without_route)?.status(); + assert_eq!(status, StatusCode::NOT_FOUND); + + let url_with_route = format!("{}{}", server.url(), "foobar"); + let status = reqwest::blocking::get(url_with_route)?.status(); + assert_eq!(status, StatusCode::OK); + + Ok(()) +} |