Add test for nested post_url

This commit is contained in:
Dave Cole 2013-04-29 17:48:10 -04:00
parent fc09ac4862
commit 805f378586
3 changed files with 30 additions and 1 deletions

View File

@ -0,0 +1,8 @@
---
layout: default
title: Nested
---
url: {{ page.url }}
date: {{ page.date }}
id: {{ page.id }}

View File

@ -14,7 +14,7 @@ class TestGeneratedSite < Test::Unit::TestCase
end end
should "ensure post count is as expected" do should "ensure post count is as expected" do
assert_equal 32, @site.posts.size assert_equal 33, @site.posts.size
end end
should "insert site.posts into the index" do should "insert site.posts into the index" do

View File

@ -204,6 +204,27 @@ CONTENT
end end
end end
context "simple page with nested post linking" do
setup do
content = <<CONTENT
---
title: Post linking
---
{% post_url es/2008-11-21-nested %}
CONTENT
create_post(content, {'permalink' => 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true})
end
should "not cause an error" do
assert_no_match /markdown\-html\-error/, @result
end
should "have the url to the \"complex\" post from 2008-11-21" do
assert_match %r{/2008/11/21/nested/}, @result
end
end
context "gist tag" do context "gist tag" do
context "simple" do context "simple" do
setup do setup do