From f830120044f4120a4844202634ae09e1a9063775 Mon Sep 17 00:00:00 2001 From: Alfred Xing Date: Mon, 7 Jul 2014 10:28:03 -0700 Subject: [PATCH] Add test for document permalink --- test/source/_slides/example-slide-3.html | 5 +++++ test/test_document.rb | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 test/source/_slides/example-slide-3.html diff --git a/test/source/_slides/example-slide-3.html b/test/source/_slides/example-slide-3.html new file mode 100644 index 00000000..5053498c --- /dev/null +++ b/test/source/_slides/example-slide-3.html @@ -0,0 +1,5 @@ +--- + title: Override permalink + layout: slide + permalink: /slide/3 +--- diff --git a/test/test_document.rb b/test/test_document.rb index 98fde67e..1af4893d 100644 --- a/test/test_document.rb +++ b/test/test_document.rb @@ -165,6 +165,23 @@ class TestDocument < Test::Unit::TestCase end end + context "a document in a collection with a custom permalink" do + setup do + @site = Site.new(Jekyll.configuration({ + "collections" => ["slides"], + "source" => source_dir, + "destination" => dest_dir + })) + @site.process + @document = @site.collections["slides"].docs[2] + end + + should "know its permalink" do + assert_equal @document.permalink, "/slide/3" + end + end + + context " a document part of a rendered collection" do end