From fbb57253a336c8744e08bd1b15bbbfc39cc8eff6 Mon Sep 17 00:00:00 2001 From: James Munns Date: Wed, 16 May 2018 20:25:05 +0200 Subject: [PATCH] Add html-alias test --- components/site/tests/site.rs | 4 ++++ test_site/content/posts/fixed-slug.md | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/components/site/tests/site.rs b/components/site/tests/site.rs index db2960e2..ddb01de5 100644 --- a/components/site/tests/site.rs +++ b/components/site/tests/site.rs @@ -128,6 +128,10 @@ fn can_build_site_without_live_reload() { assert!(file_exists!(public, "an-old-url/old-page/index.html")); assert!(file_contains!(public, "an-old-url/old-page/index.html", "something-else")); + // html aliases work + assert!(file_exists!(public, "an-old-url/an-old-alias.html")); + assert!(file_contains!(public, "an-old-url/an-old-alias.html", "something-else")); + // redirect_to works assert!(file_exists!(public, "posts/tutorials/devops/index.html")); assert!(file_contains!(public, "posts/tutorials/devops/index.html", "docker")); diff --git a/test_site/content/posts/fixed-slug.md b/test_site/content/posts/fixed-slug.md index ace8ae13..afec24bc 100644 --- a/test_site/content/posts/fixed-slug.md +++ b/test_site/content/posts/fixed-slug.md @@ -3,7 +3,7 @@ title = "Fixed slug" description = "" slug = "something-else" date = 2017-01-01 -aliases = ["/an-old-url/old-page"] +aliases = ["/an-old-url/old-page", "/an-old-url/an-old-alias.html"] +++ A simple page with a slug defined