diff --git a/tests/rendered_output.rs b/tests/rendered_output.rs index 47b5fc9f..e66791f6 100644 --- a/tests/rendered_output.rs +++ b/tests/rendered_output.rs @@ -306,19 +306,6 @@ fn theme_dir_overrides_work_correctly() { dummy_book::assert_contains_strings(built_index, &["This is a modified index.hbs!"]); } -#[test] -fn no_index_for_print_html() { - let temp = DummyBook::new().build().unwrap(); - let md = MDBook::load(temp.path()).unwrap(); - md.build().unwrap(); - - let print_html = temp.path().join("book/print.html"); - assert_contains_strings(print_html, &[r##"noindex"##]); - - let index_html = temp.path().join("book/index.html"); - assert_doesnt_contain_strings(index_html, &[r##"noindex"##]); -} - #[test] fn redirects_are_emitted_correctly() { let temp = DummyBook::new().build().unwrap(); diff --git a/tests/testsuite/print.rs b/tests/testsuite/print.rs index bac27a06..0e0cdfe0 100644 --- a/tests/testsuite/print.rs +++ b/tests/testsuite/print.rs @@ -21,3 +21,12 @@ both the print page and the non-print page.

Some section

"##]]); } + +// Checks that print.html is noindex. +#[test] +fn noindex() { + let robots = r#""#; + BookTest::from_dir("print/noindex") + .check_file_contains("book/print.html", robots) + .check_file_doesnt_contain("book/index.html", robots); +} diff --git a/tests/testsuite/print/noindex/src/SUMMARY.md b/tests/testsuite/print/noindex/src/SUMMARY.md new file mode 100644 index 00000000..655a0ded --- /dev/null +++ b/tests/testsuite/print/noindex/src/SUMMARY.md @@ -0,0 +1 @@ +- [Intro](index.md)