Skip to content

Commit

Permalink
Actually testing existing permalink_style and its effect on posts
Browse files Browse the repository at this point in the history
  • Loading branch information
qrush committed Apr 25, 2009
1 parent f3fd105 commit 73fa7dc
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/test_post.rb
Expand Up @@ -49,6 +49,7 @@ def do_render(post)
assert_equal "/2008/10/19/foo-bar.html", @post.url
end


should "respect permalink" do
file = "2008-12-03-permalinked-post.textile"
@post.process(file)
Expand All @@ -59,6 +60,30 @@ def do_render(post)
assert_equal "my_category/permalinked-post", @post.url
end

context "with permalink style of none" do
setup do
@post.site.permalink_style = :none
@post.categories = []
@post.process(@fake_file)
end

should "process the url correctly" do
assert_equal "/foo-bar.html", @post.url
end
end

context "with permalink style of pretty" do
setup do
@post.site.permalink_style = :pretty
@post.categories = []
@post.process(@fake_file)
end

should "process the url correctly" do
assert_equal "/2008/10/19/foo-bar", @post.url
end
end

should "read yaml front-matter" do
@post.read_yaml(@source, @real_file)

Expand Down

0 comments on commit 73fa7dc

Please sign in to comment.