middleman/middleman-core/features/data.feature

82 lines
2.1 KiB
Gherkin
Raw Normal View History

2011-07-06 19:29:07 +02:00
Feature: Local Data API
In order to abstract content from structure
Scenario: Rendering html
Given the Server is running at "basic-data-app"
2011-07-06 19:29:07 +02:00
When I go to "/data.html"
Then I should see "One:Two"
When the file "data/test.yml" has the contents
"""
-
title: "Three"
-
title: "Four"
"""
When I go to "/data.html"
Then I should see "Three:Four"
When the file "data/test.yml" is removed
When I go to "/data.html"
Then I should see "No Test Data"
2013-03-23 09:13:05 +01:00
2011-09-12 19:20:34 +02:00
Scenario: Rendering json
Given the Server is running at "basic-data-app"
2011-09-12 19:20:34 +02:00
When I go to "/data3.html"
Then I should see "One:Two"
When the file "data/test2.json" has the contents
"""
[
{ "title": "Three" },
{ "title": "Four" }
]
"""
When I go to "/data3.html"
Then I should see "Three:Four"
When the file "data/test2.json" is removed
When I go to "/data3.html"
Then I should see "No Test Data"
2013-03-23 09:13:05 +01:00
Scenario: Using data in config.rb
Given the Server is running at "data-app"
When I go to "/test1.html"
Then I should see "Welcome"
2013-03-23 09:13:05 +01:00
Scenario: Using data2 in config.rb
Given the Server is running at "data-app"
When I go to "/test2.html"
2013-03-23 09:13:05 +01:00
Then I should see "Welcome"
Scenario: Using nested data
Given the Server is running at "nested-data-app"
When I go to "/test.html"
Then I should see "title1:Hello"
Then I should see "title2:More"
Then I should see "title3:Stuff"
Scenario: Invalid YAML
Given a fixture app "basic-data-app"
And the default aruba timeout is 30 seconds
And a file named "data/test.yml" with:
"""
'ASDSFDa:
-asdf asdf
"""
When I run `middleman build`
Then the output should contain:
"""
failed due to an error:
"""
Scenario: Invalid JSON
Given a fixture app "basic-data-app"
And the default aruba timeout is 30 seconds
And a file named "data/test.json" with:
"""
'ASDSFDa:
-asdf asdf
"""
When I run `middleman build`
Then the output should contain:
"""
failed due to an error:
"""