Add test for #1718

move_new_block
Thomas Reynolds 2016-01-10 16:56:18 -08:00
parent b4a6a503b3
commit 5cac6a1896
4 changed files with 6 additions and 2 deletions

View File

@ -9,6 +9,7 @@ Feature: Directory Index
| a_folder/needs_index/index.html |
| leave_me_alone.html |
| wildcard_leave_me_alone.html |
| regex_leave_me_alone2.html |
| evil spaces/index.html |
| regular/index.html |
| .htaccess |
@ -21,12 +22,13 @@ Feature: Directory Index
| a_folder/needs_index.html |
| leave_me_alone/index.html |
| wildcard_leave_me_alone/index.html |
| regex_leave_me_alone2/index.html |
And the file "needs_index/index.html" should contain "Indexable"
And the file "a_folder/needs_index/index.html" should contain "Indexable"
And the file "leave_me_alone.html" should contain "Stay away"
And the file "regular/index.html" should contain "Regular"
And the file "evil spaces/index.html" should contain "Filled with Evil Spaces"
Scenario: Preview normal file
Given the Server is running at "indexable-app"
When I go to "/needs_index/"

View File

@ -2,3 +2,4 @@ activate :directory_indexes
page "/leave_me_alone.html", directory_index: false
page "/wildcard*", directory_index: false
page /regex_.*/, directory_index: false

View File

@ -0,0 +1 @@
Stay away, wildcards!

View File

@ -44,7 +44,7 @@ module Middleman
# @option opts [Hash] locals Local variables for the template. These will be available when the template renders.
# @option opts [Hash] data Extra metadata to add to the page. This is the same as frontmatter, though frontmatter will take precedence over metadata defined here. Available via {Resource#data}.
# @return [void]
Contract String, Hash => Any
Contract Or[String, Regexp], Hash => Any
def page(path, opts={})
options = opts.dup