Test documents without a title

This commit is contained in:
Chris Frederick 2014-09-01 13:32:31 +09:00
parent a5e51cfdbe
commit be2b16507e
2 changed files with 12 additions and 2 deletions

View File

@ -0,0 +1,5 @@
---
layout: slide
---
Wooot

View File

@ -207,7 +207,7 @@ class TestDocument < Test::Unit::TestCase
end
end
context "a document in a collection with custom title permalinks" do
context "documents in a collection with custom title permalinks" do
setup do
@site = Site.new(Jekyll.configuration({
"collections" => {
@ -221,11 +221,16 @@ class TestDocument < Test::Unit::TestCase
}))
@site.process
@document = @site.collections["slides"].docs[3]
@document_without_title = @site.collections["slides"].docs[4]
end
should "produce the right URL" do
should "produce the right URL if they have a title" do
assert_equal "/slides/so-what-is-jekyll-exactly", @document.url
end
should "produce the right URL if they don't have a title" do
assert_equal "/slides/example-slide-5", @document_without_title.url
end
end
context "a static file in a collection" do