Test if hidden collections output a document with a future date (#6103)
Merge pull request 6103
This commit is contained in:
parent
8221855735
commit
4299539db5
|
@ -94,6 +94,51 @@ Feature: Collections
|
|||
And I should see "Collections: _methods/3940394-21-9393050-fifif1323-test.md _methods/collection/entries _methods/configuration.md _methods/escape-\+ #%20\[\].md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/um_hi.md" in "_site/index.html" unless Windows
|
||||
And I should see "Collections: _methods/3940394-21-9393050-fifif1323-test.md _methods/collection/entries _methods/configuration.md _methods/escape-\+ #%20\[\].md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/yaml_with_dots.md" in "_site/index.html" if on Windows
|
||||
|
||||
Scenario: Rendered collection with document with future date
|
||||
Given I have a _puppies directory
|
||||
And I have the following documents under the puppies collection:
|
||||
| title | date | content |
|
||||
| Rover | 2007-12-31 | content for Rover. |
|
||||
| Fido | 2120-12-31 | content for Fido. |
|
||||
And I have a "_config.yml" file with content:
|
||||
"""
|
||||
collections:
|
||||
puppies:
|
||||
output: true
|
||||
"""
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see "content for Rover" in "_site/puppies/rover.html"
|
||||
And the "_site/puppies/fido.html" file should not exist
|
||||
When I run jekyll build --future
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And the "_site/puppies/fido.html" file should exist
|
||||
|
||||
Scenario: Hidden collection with document with future date
|
||||
Given I have a _puppies directory
|
||||
And I have the following documents under the puppies collection:
|
||||
| title | date | content |
|
||||
| Rover | 2007-12-31 | content for Rover. |
|
||||
| Fido | 2120-12-31 | content for Fido. |
|
||||
And I have a "_config.yml" file with content:
|
||||
"""
|
||||
collections:
|
||||
puppies:
|
||||
output: false
|
||||
"""
|
||||
And I have a "foo.txt" file that contains "random static file"
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And the "_site/puppies/rover.html" file should not exist
|
||||
And the "_site/puppies/fido.html" file should not exist
|
||||
When I run jekyll build --future
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And the "_site/puppies/fido.html" file should not exist
|
||||
|
||||
Scenario: All the documents
|
||||
Given I have an "index.html" page that contains "All documents: {% for doc in site.documents %}{{ doc.relative_path }} {% endfor %}"
|
||||
And I have fixture collections
|
||||
|
|
|
@ -93,6 +93,19 @@ end
|
|||
|
||||
#
|
||||
|
||||
Given(%r!^I have the following documents? under the (.*) collection:$!) do |folder, table|
|
||||
table.hashes.each do |input_hash|
|
||||
title = slug(input_hash["title"])
|
||||
filename = "#{title}.md"
|
||||
dest_folder = "_#{folder}"
|
||||
|
||||
path = File.join(dest_folder, filename)
|
||||
File.write(path, file_content_from_hash(input_hash))
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
Given(%r!^I have a configuration file with "(.*)" set to "(.*)"$!) do |key, value|
|
||||
config = \
|
||||
if source_dir.join("_config.yml").exist?
|
||||
|
|
Loading…
Reference in New Issue