Test titles in document permalinks

This commit is contained in:
Chris Frederick 2014-09-01 13:04:54 +09:00
parent cca9c50c26
commit 4dec3c8c6b
1 changed files with 22 additions and 1 deletions

View File

@ -186,7 +186,7 @@ class TestDocument < Test::Unit::TestCase
end
end
context "a document in a collection with custom permalinks" do
context "a document in a collection with custom filename permalinks" do
setup do
@site = Site.new(Jekyll.configuration({
"collections" => {
@ -207,6 +207,27 @@ class TestDocument < Test::Unit::TestCase
end
end
context "a document in a collection with custom title permalinks" do
setup do
@site = Site.new(Jekyll.configuration({
"collections" => {
"slides" => {
"output" => true,
"permalink" => "/slides/test/:title"
}
},
"source" => source_dir,
"destination" => dest_dir
}))
@site.process
@document = @site.collections["slides"].docs[0]
end
should "produce the right URL" do
assert_equal "/slides/test/example-slide", @document.url
end
end
context "a static file in a collection" do
setup do
@site = Site.new(Jekyll.configuration({