2011-07-06 10:29:07 -07:00
|
|
|
Feature: Local Data API
|
|
|
|
In order to abstract content from structure
|
|
|
|
|
2011-07-06 22:56:20 -07:00
|
|
|
Scenario: Rendering html
|
2011-12-29 15:09:51 -08:00
|
|
|
Given the Server is running at "basic-data-app"
|
2011-07-06 10:29:07 -07:00
|
|
|
When I go to "/data.html"
|
2011-09-06 11:12:20 -07:00
|
|
|
Then I should see "One:Two"
|
2013-05-29 10:59:03 -04:00
|
|
|
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 17:13:05 +09:00
|
|
|
|
2011-09-12 10:20:34 -07:00
|
|
|
Scenario: Rendering json
|
2011-12-29 15:09:51 -08:00
|
|
|
Given the Server is running at "basic-data-app"
|
2011-09-12 10:20:34 -07:00
|
|
|
When I go to "/data3.html"
|
|
|
|
Then I should see "One:Two"
|
2013-05-29 10:59:03 -04:00
|
|
|
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 17:13:05 +09:00
|
|
|
|
2011-09-17 12:43:31 -07: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 17:13:05 +09:00
|
|
|
|
2011-09-17 12:43:31 -07:00
|
|
|
Scenario: Using data2 in config.rb
|
|
|
|
Given the Server is running at "data-app"
|
|
|
|
When I go to "/test2.html"
|
2013-03-23 17:13:05 +09: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"
|
2013-05-29 09:59:15 -04:00
|
|
|
Then I should see "title1:Hello"
|
|
|
|
Then I should see "title2:More"
|
2013-05-29 10:59:03 -04:00
|
|
|
Then I should see "title3:Stuff"
|