1
0
Fork 0
mirror of https://github.com/middleman/middleman.git synced 2022-11-09 12:20:27 -05:00

test wildcard pages

This commit is contained in:
Thomas Reynolds 2011-12-07 11:26:49 -08:00
parent 9b07bf24dd
commit 745ce14624
13 changed files with 36 additions and 0 deletions

View file

@ -0,0 +1,19 @@
Feature: Wildcards in Page helper
Scenario: Setting the layout for a folder
Given the Server is running at "wildcard-app"
When I go to "/index.html"
Then I should see "Normal Layout"
When I go to "/admin/index.html"
Then I should see "Admin Layout"
When I go to "/admin/page.html"
Then I should see "Admin Layout"
Scenario: Setting the layout for a folder
Given the Server is running at "wildcard-directory-index-app"
When I go to "/"
Then I should see "Normal Layout"
When I go to "/admin/"
Then I should see "Admin Layout"
When I go to "/admin/page.html"
Then I should see "Admin Layout"

View file

@ -0,0 +1 @@
page "/admin/*", :layout => :admin

View file

@ -0,0 +1 @@
Index

View file

@ -0,0 +1 @@
Page

View file

@ -0,0 +1 @@
Index

View file

@ -0,0 +1,2 @@
Admin Layout
<%= yield %>

View file

@ -0,0 +1,2 @@
Normal Layout
<%= yield %>

View file

@ -0,0 +1,2 @@
activate :directory_indexes
page "/admin/*", :layout => :admin

View file

@ -0,0 +1 @@
Index

View file

@ -0,0 +1 @@
Page

View file

@ -0,0 +1 @@
Index

View file

@ -0,0 +1,2 @@
Admin Layout
<%= yield %>

View file

@ -0,0 +1,2 @@
Normal Layout
<%= yield %>