Merge pull request #457 from bhollis/wrap_layout

Update nested_layout tests to show that Haml still doesn't work right
This commit is contained in:
Thomas Reynolds 2012-06-02 01:02:03 -07:00
commit 239f80c1f9
9 changed files with 37 additions and 49 deletions

View file

@ -1,7 +0,0 @@
---
title: "New Article Title"
date: 2011-01-01
layout: inner
---
The Article Content

View file

@ -1,7 +0,0 @@
---
title: "New Article Title"
date: 2011-01-01
layout: inner_haml
---
The Article Content

View file

@ -1,3 +0,0 @@
- wrap_layout :outer_haml do
Inner
= yield

View file

@ -1,3 +0,0 @@
Master
= data.page.title
= yield

View file

@ -1,3 +0,0 @@
- wrap_layout :master_haml do
Outer
= yield

View file

@ -3,34 +3,45 @@ 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"
Then I should see "Template"
And I should see "Inner"
And I should see "Outer"
And I should see "Master"
Then I should see:
"""
Master
Outer
Inner
Template
"""
When I go to "/another.html"
And I should see "New Article Title"
And I should see "The Article Content"
And I should see "Inner"
And I should see "Outer"
And I should see "Master"
Then I should see:
"""
Master
New Article Title
Outer
Inner
<p>The Article Content</p>
"""
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"
And I should see "New Article Title"
And I should see "The Article Content"
And I should see "Inner"
And I should see "Outer"
And I should see "Master"
Then I should see:
"""
<h1>Master</h1><p>New Article Title</p><div><h2>Outer</h2><h3>Inner</h3><p>The Article Content</p>
</div>
"""
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"
And I should see "New Article Title"
And I should see "The Article Content"
And I should see "Inner"
And I should see "Outer"
And I should see "Master"
Then I should see:
"""
Master
New Article Title
Outer
Inner
<p>The Article Content</p>
"""
Scenario: YAML Front Matter isn't clobbered with nested layouts
Given the Server is running at "nested-layout-app"

View file

@ -1,3 +1,3 @@
- wrap_layout :outer_slim do
Inner
= yield
h3 Inner
== yield

View file

@ -1,3 +1,3 @@
Master
= data.page.title
= yield
h1 Master
p== data.page.title
div== yield

View file

@ -1,3 +1,3 @@
- wrap_layout :master_slim do
Outer
= yield
h2 Outer
== yield