From bddf2b53fd3c5dbc6ea0edb8e9a97da0c3932ae4 Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Mon, 23 Oct 2017 10:57:39 +0200 Subject: [PATCH] Add a test for shortcodes with arg --- components/site/test_site/content/posts/python.md | 2 ++ components/site/test_site/templates/shortcodes/pirate.html | 1 + components/site/tests/site.rs | 1 + 3 files changed, 4 insertions(+) create mode 100644 components/site/test_site/templates/shortcodes/pirate.html diff --git a/components/site/test_site/content/posts/python.md b/components/site/test_site/content/posts/python.md index 469158a..d1ef981 100644 --- a/components/site/test_site/content/posts/python.md +++ b/components/site/test_site/content/posts/python.md @@ -8,4 +8,6 @@ Same filename but different path {{ basic() }} +{{ pirate(name="Bob") }} + diff --git a/components/site/test_site/templates/shortcodes/pirate.html b/components/site/test_site/templates/shortcodes/pirate.html new file mode 100644 index 0000000..5a01a9c --- /dev/null +++ b/components/site/test_site/templates/shortcodes/pirate.html @@ -0,0 +1 @@ +Arrrh {{ name }} diff --git a/components/site/tests/site.rs b/components/site/tests/site.rs index 4220f14..ce9d435 100644 --- a/components/site/tests/site.rs +++ b/components/site/tests/site.rs @@ -109,6 +109,7 @@ fn can_build_site_without_live_reload() { assert!(file_exists!(public, "posts/python/index.html")); // Shortcodes work assert!(file_contains!(public, "posts/python/index.html", "Basic shortcode")); + assert!(file_contains!(public, "posts/python/index.html", "Arrrh Bob")); assert!(file_exists!(public, "posts/tutorials/devops/nix/index.html")); assert!(file_exists!(public, "posts/with-assets/index.html")); assert!(file_exists!(public, "posts/no-section/simple/index.html"));