change features and tests to make sure categories in urls follow the order specified by directory layout or in yaml

This commit is contained in:
Thomas Jack 2009-06-08 19:26:03 -05:00
parent 486ae25fc1
commit 535d78de7d
2 changed files with 8 additions and 8 deletions

View File

@ -82,17 +82,17 @@ Feature: Post data
And I should see "Post tags: twist" in "_site/2009/05/18/star-wars.html"
Scenario: Use post.categories variable when categories are in folders
Given I have a movies directory
And I have a movies/scifi directory
And I have a movies/scifi/_posts directory
Given I have a scifi directory
And I have a scifi/movies directory
And I have a scifi/movies/_posts directory
And I have a _layouts directory
And I have the following post in "movies/scifi":
And I have the following post in "scifi/movies":
| title | date | layout | content |
| Star Wars | 3/27/2009 | simple | Luke, I am your father. |
And I have a simple layout that contains "Post categories: {{ site.posts.first.categories | array_to_sentence_string }}"
When I run jekyll
Then the _site directory should exist
And I should see "Post categories: movies and scifi" in "_site/movies/scifi/2009/03/27/star-wars.html"
And I should see "Post categories: scifi and movies" in "_site/scifi/movies/2009/03/27/star-wars.html"
Scenario: Use post.categories variable when category is in YAML
Given I have a _posts directory
@ -110,11 +110,11 @@ Feature: Post data
And I have a _layouts directory
And I have the following post:
| title | date | layout | categories | content |
| Star Wars | 3/27/2009 | simple | ['movies', 'scifi'] | Luke, I am your father. |
| Star Wars | 3/27/2009 | simple | ['scifi', 'movies'] | Luke, I am your father. |
And I have a simple layout that contains "Post categories: {{ site.posts.first.categories | array_to_sentence_string }}"
When I run jekyll
Then the _site directory should exist
And I should see "Post categories: movies and scifi" in "_site/movies/scifi/2009/03/27/star-wars.html"
And I should see "Post categories: scifi and movies" in "_site/scifi/movies/2009/03/27/star-wars.html"
Scenario: Disable a post from being published
Given I have a _posts directory

View File

@ -105,7 +105,7 @@ class TestPost < Test::Unit::TestCase
should "process the url correctly" do
assert_equal "/:categories/:year/:month/:day/:title.html", @post.template
assert_equal "/beer/food/2008/10/19/foo-bar.html", @post.url
assert_equal "/food/beer/2008/10/19/foo-bar.html", @post.url
end
end