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:
parent
9b07bf24dd
commit
745ce14624
13 changed files with 36 additions and 0 deletions
19
features/wildcard_page_helper.feature
Normal file
19
features/wildcard_page_helper.feature
Normal 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"
|
1
fixtures/wildcard-app/config.rb
Normal file
1
fixtures/wildcard-app/config.rb
Normal file
|
@ -0,0 +1 @@
|
|||
page "/admin/*", :layout => :admin
|
1
fixtures/wildcard-app/source/admin/index.html.erb
Normal file
1
fixtures/wildcard-app/source/admin/index.html.erb
Normal file
|
@ -0,0 +1 @@
|
|||
Index
|
1
fixtures/wildcard-app/source/admin/page.html.erb
Normal file
1
fixtures/wildcard-app/source/admin/page.html.erb
Normal file
|
@ -0,0 +1 @@
|
|||
Page
|
1
fixtures/wildcard-app/source/index.html.erb
Normal file
1
fixtures/wildcard-app/source/index.html.erb
Normal file
|
@ -0,0 +1 @@
|
|||
Index
|
2
fixtures/wildcard-app/source/layouts/admin.erb
Normal file
2
fixtures/wildcard-app/source/layouts/admin.erb
Normal file
|
@ -0,0 +1,2 @@
|
|||
Admin Layout
|
||||
<%= yield %>
|
2
fixtures/wildcard-app/source/layouts/layout.erb
Normal file
2
fixtures/wildcard-app/source/layouts/layout.erb
Normal file
|
@ -0,0 +1,2 @@
|
|||
Normal Layout
|
||||
<%= yield %>
|
2
fixtures/wildcard-directory-index-app/config.rb
Normal file
2
fixtures/wildcard-directory-index-app/config.rb
Normal file
|
@ -0,0 +1,2 @@
|
|||
activate :directory_indexes
|
||||
page "/admin/*", :layout => :admin
|
|
@ -0,0 +1 @@
|
|||
Index
|
|
@ -0,0 +1 @@
|
|||
Page
|
|
@ -0,0 +1 @@
|
|||
Index
|
|
@ -0,0 +1,2 @@
|
|||
Admin Layout
|
||||
<%= yield %>
|
|
@ -0,0 +1,2 @@
|
|||
Normal Layout
|
||||
<%= yield %>
|
Loading…
Reference in a new issue