Skip to content

Commit 6aecfa0

Browse files
Nemo157Joshua Nelson
authored andcommitted
Add test for missing target with target-redirect
1 parent 8873e6a commit 6aecfa0

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/web/rustdoc.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,29 @@ mod test {
866866
})
867867
}
868868

869+
#[test]
870+
fn no_target_target_redirect_404s() {
871+
wrapper(|env| {
872+
assert_eq!(
873+
env.frontend()
874+
.get("/crate/dummy/0.1.0/target-redirect")
875+
.send()?
876+
.status(),
877+
StatusCode::NOT_FOUND
878+
);
879+
880+
assert_eq!(
881+
env.frontend()
882+
.get("/crate/dummy/0.1.0/target-redirect/")
883+
.send()?
884+
.status(),
885+
StatusCode::NOT_FOUND
886+
);
887+
888+
Ok(())
889+
})
890+
}
891+
869892
#[test]
870893
fn platform_links_go_to_current_path() {
871894
fn get_platform_links(

0 commit comments

Comments
 (0)