2011-07-08 01:30:30 +02:00
|
|
|
Feature: YAML Front Matter
|
|
|
|
In order to specific options and data inline
|
|
|
|
|
2012-05-09 22:15:39 +02:00
|
|
|
Scenario: Rendering html (yaml)
|
2011-12-30 00:09:51 +01:00
|
|
|
Given the Server is running at "frontmatter-app"
|
2011-12-12 01:22:38 +01:00
|
|
|
When I go to "/front-matter-2.php"
|
|
|
|
Then I should see "<h1>This is the title</h1>"
|
|
|
|
Then I should see "<?php"
|
|
|
|
Then I should not see "---"
|
2012-05-25 22:17:22 +02:00
|
|
|
|
2012-12-31 05:29:39 +01:00
|
|
|
Scenario: Rendering raw (template-less) (yaml)
|
|
|
|
Given the Server is running at "frontmatter-app"
|
|
|
|
When I go to "/raw-front-matter.html"
|
2013-05-29 11:25:57 +02:00
|
|
|
Then I should see "<h1><%= current_page.data.title %></h1>"
|
2012-12-31 05:29:39 +01:00
|
|
|
Then I should not see "---"
|
|
|
|
When I go to "/raw-front-matter.php"
|
|
|
|
Then I should see '<?php echo "sup"; ?>'
|
|
|
|
Then I should see "<?php"
|
|
|
|
Then I should not see "---"
|
|
|
|
|
2014-08-15 04:15:17 +02:00
|
|
|
Scenario: Rendering markdown (template-less) (yaml)
|
|
|
|
Given the Server is running at "frontmatter-app"
|
|
|
|
When I go to "/front-matter-pandoc.html"
|
|
|
|
Then I should see ">This is a document</h1>"
|
|
|
|
Then I should see "<p>To be or not to be</p>"
|
|
|
|
Then I should see "The meaning of life is 42"
|
|
|
|
Then I should not see "..."
|
|
|
|
Then I should not see "layout: false"
|
|
|
|
Then I should not see "title: Pandoc likes trailing dots..."
|
|
|
|
|
2015-10-23 11:08:09 +02:00
|
|
|
Scenario: Rendering Haml (yaml)
|
|
|
|
Given the Server is running at "frontmatter-app"
|
|
|
|
When I go to "/front-matter-haml.html"
|
|
|
|
Then I should see "<h1>This is the title</h1>"
|
|
|
|
Then I should not see "---"
|
2014-08-15 04:15:17 +02:00
|
|
|
|
2012-05-25 22:17:22 +02:00
|
|
|
Scenario: YAML not on first line, no encoding
|
|
|
|
Given the Server is running at "frontmatter-app"
|
|
|
|
When I go to "/front-matter-line-2.html"
|
|
|
|
Then I should see "<h1></h1>"
|
|
|
|
Then I should see "---"
|
2015-10-23 11:08:09 +02:00
|
|
|
|
2012-05-25 22:17:22 +02:00
|
|
|
Scenario: YAML not on first line, with encoding
|
|
|
|
Given the Server is running at "frontmatter-app"
|
|
|
|
When I go to "/front-matter-encoding.html"
|
|
|
|
Then I should see "<h1>This is the title</h1>"
|
|
|
|
Then I should not see "---"
|
2011-12-08 06:05:53 +01:00
|
|
|
|
|
|
|
Scenario: A template changes frontmatter during preview
|
2011-12-30 00:09:51 +01:00
|
|
|
Given the Server is running at "frontmatter-app"
|
2011-12-08 06:05:53 +01:00
|
|
|
And the file "source/front-matter-change.html.erb" has the contents
|
|
|
|
"""
|
|
|
|
---
|
|
|
|
title: Hello World
|
|
|
|
layout: false
|
|
|
|
---
|
2013-05-29 11:25:57 +02:00
|
|
|
<%= current_page.data.title %>
|
2011-12-08 06:05:53 +01:00
|
|
|
"""
|
|
|
|
When I go to "/front-matter-change.html"
|
|
|
|
Then I should see "Hello World"
|
|
|
|
And the file "source/front-matter-change.html.erb" has the contents
|
|
|
|
"""
|
|
|
|
---
|
|
|
|
title: Hola Mundo
|
|
|
|
layout: false
|
|
|
|
---
|
2013-05-29 11:25:57 +02:00
|
|
|
<%= current_page.data.title %>
|
2011-12-08 06:05:53 +01:00
|
|
|
"""
|
|
|
|
When I go to "/front-matter-change.html"
|
2012-12-03 01:15:36 +01:00
|
|
|
Then I should see "Hola Mundo"
|
|
|
|
|
|
|
|
Scenario: A template should handle an empty YAML feed
|
|
|
|
Given the Server is running at "frontmatter-app"
|
|
|
|
And the file "source/front-matter-change.html.erb" has the contents
|
|
|
|
"""
|
|
|
|
---
|
|
|
|
---
|
|
|
|
Hello World
|
|
|
|
"""
|
|
|
|
When I go to "/front-matter-change.html"
|
|
|
|
Then I should see "Hello World"
|