2011-11-27 00:32:41 +01:00
|
|
|
Feature: Provide Sane Defaults for Partial Behavior
|
|
|
|
|
|
|
|
Scenario: Finds shared partials relative to the root
|
|
|
|
Given the Server is running at "partials-app"
|
|
|
|
When I go to "/index.html"
|
|
|
|
Then I should see "Header"
|
|
|
|
And I should see "Footer"
|
|
|
|
|
|
|
|
Scenario: Finds shared partials relative to the root (sub)
|
|
|
|
Given the Server is running at "partials-app"
|
|
|
|
When I go to "/sub/index.html"
|
|
|
|
Then I should see "Header"
|
|
|
|
And I should see "Footer"
|
2012-04-20 19:34:22 +02:00
|
|
|
|
2011-11-27 00:32:41 +01:00
|
|
|
Scenario: Prefers partials of the same engine type
|
|
|
|
Given the Server is running at "partials-app"
|
|
|
|
When I go to "/index.html"
|
|
|
|
Then I should see "ERb Main"
|
|
|
|
|
|
|
|
Scenario: Prefers partials of the same engine type
|
|
|
|
Given the Server is running at "partials-app"
|
|
|
|
When I go to "/second.html"
|
2011-12-30 00:09:51 +01:00
|
|
|
Then I should see "Str Main"
|
2011-11-27 00:32:41 +01:00
|
|
|
And I should see "Header"
|
|
|
|
And I should see "Footer"
|
|
|
|
|
|
|
|
Scenario: Finds partial relative to template
|
|
|
|
Given the Server is running at "partials-app"
|
|
|
|
When I go to "/sub/index.html"
|
2011-11-28 06:56:21 +01:00
|
|
|
Then I should see "Local Partial"
|
|
|
|
|
|
|
|
Scenario: Partials can be passed locals
|
|
|
|
Given the Server is running at "partials-app"
|
|
|
|
When I go to "/locals.html"
|
2011-12-01 07:38:34 +01:00
|
|
|
Then I should see "Local var is bar"
|
|
|
|
|
2011-12-01 07:39:50 +01:00
|
|
|
Scenario: Partial and Layout use different engines
|
2011-12-01 07:38:34 +01:00
|
|
|
Given the Server is running at "different-engine-partial"
|
|
|
|
When I go to "/index.html"
|
2011-12-02 07:43:41 +01:00
|
|
|
Then I should see "ERb Header"
|
2011-12-30 00:09:51 +01:00
|
|
|
And I should see "Str Footer"
|
2014-07-18 19:54:48 +02:00
|
|
|
|
|
|
|
Scenario: Works with non-template content (svg)
|
|
|
|
Given the Server is running at "partials-app"
|
|
|
|
When I go to "/svg.html"
|
|
|
|
Then I should see "<svg"
|
2014-07-24 20:11:27 +02:00
|
|
|
When I go to "/static_underscore.html"
|
|
|
|
Then I should see "<p>Hello World</p>"
|
|
|
|
When I go to "/code_snippet.html"
|
|
|
|
Then I should see "File Not Found"
|
|
|
|
When I go to "/_code_snippet.html"
|
|
|
|
Then I should see "File Not Found"
|
2016-02-03 22:55:11 +01:00
|
|
|
|
|
|
|
Scenario: Works with blocks
|
|
|
|
Given the Server is running at "partials-app"
|
|
|
|
When I go to "/block.html"
|
|
|
|
Then I should see "Start"
|
|
|
|
And I should see "Contents"
|
|
|
|
And I should see "End"
|