Update nested_layout tests to show that Haml still doesn't work right. Also updated Slim and ERb tests to verify ordering of output.

This commit is contained in:
Ben Hollis 2012-06-02 00:35:03 -07:00
parent f287e0a2bc
commit efa846341d
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 Scenario: A page uses an inner layout when uses an outer layout
Given the Server is running at "nested-layout-app" Given the Server is running at "nested-layout-app"
When I go to "/index.html" When I go to "/index.html"
Then I should see "Template" Then I should see:
And I should see "Inner" """
And I should see "Outer" Master
And I should see "Master" Outer
Inner
Template
"""
When I go to "/another.html" When I go to "/another.html"
And I should see "New Article Title" Then I should see:
And I should see "The Article Content" """
And I should see "Inner" Master
And I should see "Outer" New Article Title
And I should see "Master" Outer
Inner
<p>The Article Content</p>
"""
Scenario: A page uses an inner layout when uses an outer layout (slim) Scenario: A page uses an inner layout when uses an outer layout (slim)
Given the Server is running at "nested-layout-app" Given the Server is running at "nested-layout-app"
When I go to "/slim-test.html" When I go to "/slim-test.html"
And I should see "New Article Title" Then I should see:
And I should see "The Article Content" """
And I should see "Inner" <h1>Master</h1><p>New Article Title</p><div><h2>Outer</h2><h3>Inner</h3><p>The Article Content</p>
And I should see "Outer" </div>
And I should see "Master" """
Scenario: A page uses an inner layout when uses an outer layout (haml) Scenario: A page uses an inner layout when uses an outer layout (haml)
Given the Server is running at "nested-layout-app" Given the Server is running at "nested-layout-app"
When I go to "/haml-test.html" When I go to "/haml-test.html"
And I should see "New Article Title" Then I should see:
And I should see "The Article Content" """
And I should see "Inner" Master
And I should see "Outer" New Article Title
And I should see "Master" Outer
Inner
<p>The Article Content</p>
"""
Scenario: YAML Front Matter isn't clobbered with nested layouts Scenario: YAML Front Matter isn't clobbered with nested layouts
Given the Server is running at "nested-layout-app" Given the Server is running at "nested-layout-app"

View file

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

View file

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

View file

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