From 12d9f8b02bffb0cc779d78216d302758c7a4eb09 Mon Sep 17 00:00:00 2001 From: Anatol Broder Date: Mon, 5 May 2014 10:49:29 +0200 Subject: [PATCH] Add scenario for ordering pages without title last --- features/embed_filters.feature | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/features/embed_filters.feature b/features/embed_filters.feature index e0d85cbd..b1a420f5 100644 --- a/features/embed_filters.feature +++ b/features/embed_filters.feature @@ -89,3 +89,19 @@ Feature: Embed filters When I run jekyll build Then the _site directory should exist And I should see exactly "The rule of 3: Jump, Fly, Run," in "_site/bird.html" + + Scenario: Sort pages by the title ordering pages without title last + Given I have a _layouts directory + And I have the following page: + | title | layout | content | + | Dog | default | Run | + And I have the following page: + | title | layout | content | + | Bird | default | Fly | + And I have the following page: + | layout | content | + | default | Jump | + And I have a default layout that contains "{% assign sorted_pages = site.pages | sort: 'title', true %}The rule of {{ sorted_pages.size }}: {% for p in sorted_pages %}{{ p.content | strip_html | strip_newlines }}, {% endfor %}" + When I run jekyll build + Then the _site directory should exist + And I should see exactly "The rule of 3: Fly, Run, Jump," in "_site/bird.html"