The :title URL placeholder for collections should be the filename slug.

This mimicks posts most closely. It can be overridden by the
YAML front matter.

Undoes some of #2864.
This commit is contained in:
Parker Moore
2015-01-30 01:53:11 -08:00
parent dcd3dafdbc
commit 0c624eb11b
5 changed files with 30 additions and 7 deletions

View File

@@ -249,15 +249,20 @@ class TestDocument < Test::Unit::TestCase
}))
@site.process
@document = @site.collections["slides"].docs[3]
@document_without_title = @site.collections["slides"].docs[4]
@document_without_slug = @site.collections["slides"].docs[4]
@document_with_strange_slug = @site.collections["slides"].docs[5]
end
should "produce the right URL if they have a title" do
should "produce the right URL if they have a slug" 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
should "produce the right URL if they don't have a slug" do
assert_equal "/slides/example-slide-5", @document_without_slug.url
end
should "produce the right URL if they have a wild slug" do
assert_equal "/slides/well-so-what-is-jekyll-then", @document_with_strange_slug.url
end
end