This commit is contained in:
Thomas Reynolds 2012-06-17 12:03:36 -07:00
parent 4ea2f6f7ed
commit 5071a2c15d
7 changed files with 30 additions and 1 deletions

View file

@ -47,4 +47,18 @@ Feature: Custom layouts
When I go to "/custom-layout-dir/" When I go to "/custom-layout-dir/"
Then I should see "Custom Layout" Then I should see "Custom Layout"
When I go to "/custom-layout-dir/index.html" When I go to "/custom-layout-dir/index.html"
Then I should see "Custom Layout" Then I should see "Custom Layout"
Scenario: Setting layout inside a matching page block
Given the Server is running at "page-helper-layout-block-app"
When I go to "/index.html"
Then I should see "Hello"
And I should see "World"
When I go to "/path/child.html"
Then I should see "Alt"
And I should see "Child"
And I should not see "Hello"
When I go to "/path/index.html"
Then I should see "Alt"
And I should see "Monde"
And I should not see "Hello"

View file

@ -0,0 +1,6 @@
page "/path/*", :layout => "alt"
# Doesn't work, and shouldn't
# page "/path/*" do
# set :layout, "alt"
# end

View file

@ -0,0 +1,3 @@
Alt
<%= yield %>

View file

@ -0,0 +1,3 @@
Hello
<%= yield %>