Added a scenario for #4414

This commit is contained in:
Nathan Hazout 2016-06-15 11:21:02 +03:00
parent 3fe9e92c4f
commit d1f4d874be
1 changed files with 25 additions and 0 deletions

View File

@ -333,3 +333,28 @@ Feature: Hooks
Then I should get a zero exit status
And the _site directory should exist
And I should see "Wrote document 0" in "_site/document-build.log"
Scenario: Set a custom payload['page'] property
Given I have a _plugins directory
And I have a "_plugins/ext.rb" file with content:
"""
Jekyll::Hooks.register :pages, :pre_render do |page, payload|
payload['page']['foo'] = "hello world"
end
"""
And I have a _layouts directory
And I have a "_layouts/custom.html" file with content:
"""
---
---
{{ content }} {% include foo.html %}
"""
And I have a _includes directory
And I have a "_includes/foo.html" file with content:
"""
{{page.foo}}
"""
And I have an "index.html" page with layout "custom" that contains "page content"
When I run jekyll build
Then the "_site/index.html" file should exist
And I should see "page content\n hello world" in "_site/index.html"