File: pagination.feature

package info (click to toggle)
jekyll 2.2.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,908 kB
  • ctags: 687
  • sloc: ruby: 6,811; sh: 121; xml: 106; makefile: 35
file content (82 lines) | stat: -rw-r--r-- 4,183 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
Feature: Site pagination
  In order to paginate my blog
  As a blog's user
  I want divide the posts in several pages

  Scenario Outline: Paginate with N posts per page
    Given I have a configuration file with "paginate" set to "<num>"
    And I have a _layouts directory
    And I have an "index.html" page that contains "{{ paginator.posts.size }}"
    And I have a _posts directory
    And I have the following posts:
      | title     | date       | layout  | content                                |
      | Wargames  | 2009-03-27 | default | The only winning move is not to play.  |
      | Wargames2 | 2009-04-27 | default | The only winning move is not to play2. |
      | Wargames3 | 2009-05-27 | default | The only winning move is not to play3. |
      | Wargames4 | 2009-06-27 | default | The only winning move is not to play4. |
    When I run jekyll build
    Then the _site/page<exist> directory should exist
    And the "_site/page<exist>/index.html" file should exist
    And I should see "<posts>" in "_site/page<exist>/index.html"
    And the "_site/page<not_exist>/index.html" file should not exist

    Examples:
      | num | exist | posts | not_exist |
      | 1   | 4     | 1     | 5         |
      | 2   | 2     | 2     | 3         |
      | 3   | 2     | 1     | 3         |

  Scenario Outline: Setting a custom pagination path
    Given I have a configuration file with:
      | key           | value                          |
      | paginate      | 1                              |
      | paginate_path | /blog/page-:num                |
      | permalink     | /blog/:year/:month/:day/:title |
    And I have a blog directory
    And I have an "blog/index.html" page that contains "{{ paginator.posts.size }}"
    And I have a _posts directory
    And I have the following posts:
      | title     | date       | layout  | content                                |
      | Wargames  | 2009-03-27 | default | The only winning move is not to play.  |
      | Wargames2 | 2009-04-27 | default | The only winning move is not to play2. |
      | Wargames3 | 2009-05-27 | default | The only winning move is not to play3. |
      | Wargames4 | 2009-06-27 | default | The only winning move is not to play4. |
    When I run jekyll build
    Then the _site/blog/page-<exist> directory should exist
    And the "_site/blog/page-<exist>/index.html" file should exist
    And I should see "<posts>" in "_site/blog/page-<exist>/index.html"
    And the "_site/blog/page-<not_exist>/index.html" file should not exist

    Examples:
      | exist | posts | not_exist |
      | 2     | 1     | 5         |
      | 3     | 1     | 6         |
      | 4     | 1     | 7         |

  Scenario Outline: Setting a custom pagination path without an index.html in it
    Given I have a configuration file with:
      | key           | value                          |
      | paginate      | 1                              |
      | paginate_path | /blog/page/:num                |
      | permalink     | /blog/:year/:month/:day/:title |
    And I have a blog directory
    And I have an "blog/index.html" page that contains "{{ paginator.posts.size }}"
    And I have an "index.html" page that contains "Don't pick me!"
    And I have a _posts directory
    And I have the following posts:
      | title     | date       | layout  | content                                |
      | Wargames  | 2009-03-27 | default | The only winning move is not to play.  |
      | Wargames2 | 2009-04-27 | default | The only winning move is not to play2. |
      | Wargames3 | 2009-05-27 | default | The only winning move is not to play3. |
      | Wargames4 | 2009-06-27 | default | The only winning move is not to play4. |
    When I run jekyll build
    Then the _site/blog/page/<exist> directory should exist
    And the "_site/blog/page/<exist>/index.html" file should exist
    And I should see "<posts>" in "_site/blog/page/<exist>/index.html"
    And the "_site/blog/page/<not_exist>/index.html" file should not exist

    Examples:
      | exist | posts | not_exist |
      | 2     | 1     | 5         |
      | 3     | 1     | 6         |
      | 4     | 1     | 7         |