2011-12-22 03:42:14 -05:00
|
|
|
Feature: Allow nesting of layouts
|
|
|
|
|
|
|
|
Scenario: A page uses an inner layout when uses an outer layout
|
|
|
|
Given the Server is running at "nested-layout-app"
|
|
|
|
When I go to "/index.html"
|
2012-06-02 03:35:03 -04:00
|
|
|
Then I should see:
|
|
|
|
"""
|
2016-01-29 13:30:08 -05:00
|
|
|
Master Erb
|
2012-06-02 17:19:45 -04:00
|
|
|
<h1>Index Title</h1>
|
2016-01-29 13:30:08 -05:00
|
|
|
I am Outer
|
|
|
|
I am Inner
|
2015-09-30 13:24:12 -04:00
|
|
|
Template
|
2016-01-29 13:30:08 -05:00
|
|
|
|
2012-06-02 03:35:03 -04:00
|
|
|
"""
|
2012-03-25 02:41:37 -04:00
|
|
|
When I go to "/another.html"
|
2012-06-02 03:35:03 -04:00
|
|
|
Then I should see:
|
|
|
|
"""
|
2016-01-29 13:30:08 -05:00
|
|
|
Master Erb
|
2012-06-02 17:19:45 -04:00
|
|
|
<h1>New Article Title</h1>
|
2016-01-29 13:30:08 -05:00
|
|
|
I am Outer
|
|
|
|
I am Inner
|
2015-09-30 13:24:12 -04:00
|
|
|
<p>The Article Content</p>
|
2012-06-02 03:35:03 -04:00
|
|
|
"""
|
2016-01-29 13:30:08 -05:00
|
|
|
|
2012-06-01 23:05:07 -04:00
|
|
|
Scenario: A page uses an inner layout when uses an outer layout (slim)
|
|
|
|
Given the Server is running at "nested-layout-app"
|
|
|
|
When I go to "/slim-test.html"
|
2016-01-29 13:30:08 -05:00
|
|
|
Then I should see "<h1>Master Slim</h1><p>New Article Title</p><div><h2>I am Outer</h2><h3>I am Inner</h3><p>The Article Content</p>"
|
|
|
|
|
2012-06-01 23:05:07 -04:00
|
|
|
Scenario: A page uses an inner layout when uses an outer layout (haml)
|
|
|
|
Given the Server is running at "nested-layout-app"
|
|
|
|
When I go to "/haml-test.html"
|
2012-06-02 03:35:03 -04:00
|
|
|
Then I should see:
|
|
|
|
"""
|
2016-01-29 13:30:08 -05:00
|
|
|
Master Haml
|
2012-06-02 17:19:45 -04:00
|
|
|
<h1>New Article Title</h1>
|
2016-01-29 13:30:08 -05:00
|
|
|
I am Outer
|
|
|
|
I am Inner
|
2012-06-02 03:35:03 -04:00
|
|
|
<p>The Article Content</p>
|
|
|
|
"""
|
2011-12-22 17:38:34 -05:00
|
|
|
|
|
|
|
Scenario: YAML Front Matter isn't clobbered with nested layouts
|
|
|
|
Given the Server is running at "nested-layout-app"
|
|
|
|
When I go to "/data-one.html"
|
|
|
|
Then I should see "Page Number One"
|
2016-01-29 13:30:08 -05:00
|
|
|
And I should see "Page #1"
|
|
|
|
And I should see "I am Inner"
|
|
|
|
And I should see "I am Outer"
|
|
|
|
And I should see "Master Erb"
|
2011-12-22 17:38:34 -05:00
|
|
|
When I go to "/data-two.html"
|
|
|
|
Then I should see "Page Number Two"
|
2016-01-29 13:30:08 -05:00
|
|
|
And I should not see "I am Inner"
|
2011-12-22 17:38:34 -05:00
|
|
|
When I go to "/data-one.html"
|
|
|
|
Then I should see "Page Number One"
|
2016-01-29 13:30:08 -05:00
|
|
|
And I should see "I am Inner"
|
2011-12-22 17:38:34 -05:00
|
|
|
When I go to "/data-two.html"
|
2011-12-23 00:19:49 -05:00
|
|
|
Then I should see "Page Number Two"
|
2016-01-29 13:30:08 -05:00
|
|
|
And I should not see "I am Inner"
|