Skip to content

Commit 6e73ef0

Browse files
committed
kk
1 parent 68b603c commit 6e73ef0

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/web/rustdoc.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3004,6 +3004,31 @@ mod test {
30043004
})
30053005
}
30063006

3007+
#[tokio::test(flavor = "multi_thread")]
3008+
#[test_case("folder/file.js")]
3009+
#[test_case("root.css")]
3010+
async fn test_static_asset_handler(path: &str) -> Result<()> {
3011+
let env = TestEnvironment::new().await?;
3012+
3013+
let storage = env.async_storage();
3014+
storage
3015+
.store_one(
3016+
format!("{RUSTDOC_STATIC_STORAGE_PREFIX}{path}"),
3017+
b"static content",
3018+
)
3019+
.await?;
3020+
3021+
let web = env.web_app().await;
3022+
3023+
web.assert_success_and_conditional_get(
3024+
&format!("/-/rustdoc.static/{path}"),
3025+
"static content",
3026+
)
3027+
.await?;
3028+
3029+
Ok(())
3030+
}
3031+
30073032
#[test_case("search-1234.js")]
30083033
#[test_case("settings-1234.js")]
30093034
fn fallback_to_root_storage_for_some_js_assets(path: &str) {

0 commit comments

Comments
 (0)