Also test frontmatter options in preview mode (exposed proxy bug, which was fixed

This commit is contained in:
Thomas Reynolds 2012-01-07 18:11:56 -08:00
parent 7282475350
commit 34e40cbe01
2 changed files with 21 additions and 3 deletions

View file

@ -1,5 +1,5 @@
Feature: Setting page settings through frontmatter Feature: Setting page settings through frontmatter
Scenario: Setting layout, ignoring, and disabling directory indexes through frontmatter Scenario: Setting layout, ignoring, and disabling directory indexes through frontmatter (build)
Given a successfully built app at "frontmatter-settings-app" Given a successfully built app at "frontmatter-settings-app"
Then the following files should exist: Then the following files should exist:
| build/proxied/index.html | | build/proxied/index.html |
@ -8,3 +8,20 @@ Feature: Setting page settings through frontmatter
And the following files should not exist: And the following files should not exist:
| build/ignored/index.html | | build/ignored/index.html |
| build/no_index/index.html | | build/no_index/index.html |
Scenario: Setting layout, ignoring, and disabling directory indexes through frontmatter (preview)
Given the Server is running at "frontmatter-settings-app"
# When I go to "/proxied/"
# Then I should not see "File Not Found"
When I go to "/no_index.html"
Then I should not see "File Not Found"
When I go to "/alternate_layout/"
Then I should not see "File Not Found"
And I should see "Alternate layout"
When I go to "/ignored.html"
Then I should see "File Not Found"
When I go to "/ignored/index.html"
Then I should see "File Not Found"
When I go to "/no_index/index.html"
Then I should see "File Not Found"

View file

@ -112,9 +112,10 @@ module Middleman::CoreExtensions::FrontMatter
p = @app.sitemap.page(path) p = @app.sitemap.page(path)
file_path = p.source_file.sub(@app.source_dir, "") file_path = p.source_file.sub(@app.source_dir, "")
if has_data?(file_path) if !p.proxy? && has_data?(file_path)
d = data(file_path) d = data(file_path)
if d && d[0] if d && d[0]
$stderr.puts "Should ignore #{path}", p.source_file
d[0].has_key?("ignored") && d[0]["ignored"] == true d[0].has_key?("ignored") && d[0]["ignored"] == true
else else
false false