Move off-by-default extensions into middleman-more, make middleman-more itself an extension

This commit is contained in:
Thomas Reynolds 2012-05-24 16:14:17 -07:00
parent 182ad87ad3
commit 1cad726c81
92 changed files with 902 additions and 758 deletions

View file

@ -1,7 +0,0 @@
Feature: Alternate between multiple asset hosts
In order to speed up page loading
Scenario: Rendering html with the feature enabled
Given the Server is running at "asset-host-app"
When I go to "/asset_host.html"
Then I should see "http://assets"

View file

@ -1,16 +0,0 @@
Feature: Automatically detect and insert image dimensions into tags
In order to speed up development and appease YSlow
Scenario: Rendering an image with the feature disabled
Given "automatic_image_sizes" feature is "disabled"
And the Server is running at "automatic-image-size-app"
When I go to "/auto-image-sizes.html"
Then I should not see "width="
And I should not see "height="
Scenario: Rendering an image with the feature enabled
Given "automatic_image_sizes" feature is "enabled"
And the Server is running at "automatic-image-size-app"
When I go to "/auto-image-sizes.html"
Then I should see "width="
And I should see "height="

View file

@ -16,19 +16,6 @@ Feature: Build Clean
| build/should_be_ignored3.html |
And the file "build/index.html" should contain "Comment in layout"
Scenario: Clean an app with directory indexes
Given a successfully built app at "clean-dir-app"
Then the following files should exist:
| build/about/index.html |
Given a successfully built app at "clean-dir-app" with flags "--clean"
Then the following files should exist:
| build/about/index.html |
Scenario: Clean build an app that's never been built
Given a successfully built app at "clean-dir-app" with flags "--clean"
Then the following files should exist:
| build/about/index.html |
Scenario: Clean build an app with newly ignored files and a nested output directory
Given a built app at "clean-nested-app"
Then a directory named "sub/dir" should exist

View file

@ -1,66 +0,0 @@
Feature: Directory Index
In order output Apache-friendly directories and indexes
Scenario: Checking built folder for content
Given a successfully built app at "indexable-app"
When I cd to "build"
Then the following files should exist:
| needs_index/index.html |
| a_folder/needs_index/index.html |
| leave_me_alone.html |
| wildcard_leave_me_alone.html |
| regular/index.html |
| .htaccess |
Then the following files should not exist:
| egular/index/index.html |
| needs_index.html |
| a_folder/needs_index.html |
| leave_me_alone/index.html |
| wildcard_leave_me_alone/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"
Scenario: Preview normal file
Given the Server is running at "indexable-app"
When I go to "/needs_index/"
Then I should see "Indexable"
Scenario: Preview normal file subdirectory
Given the Server is running at "indexable-app"
When I go to "/a_folder/needs_index/"
Then I should see "Indexable"
Scenario: Preview ignored file
Given the Server is running at "indexable-app"
When I go to "/leave_me_alone/"
Then I should see "File Not Found"
Scenario: Link_to knows about directory indexes
Given a fixture app "indexable-app"
And a file named "source/link_to.html.erb" with:
"""
link_to: <%= link_to "Needs Index", "/needs_index.html" %>
explicit_link_to: <%= link_to "Explicit", "/needs_index/index.html" %>
unknown_link_to: <%= link_to "Unknown", "/unknown.html" %>
relative_link_to: <%= link_to "Relative", "needs_index.html" %>
"""
And a file named "source/link_to/sub.html.erb" with:
"""
link_to: <%= link_to "Needs Index", "/needs_index.html" %>
explicit_link_to: <%= link_to "Explicit", "/needs_index/index.html" %>
unknown_link_to: <%= link_to "Unknown", "/unknown.html" %>
relative_link_to: <%= link_to "Relative", "../needs_index.html" %>
"""
And the Server is running at "indexable-app"
When I go to "/link_to/"
Then I should see 'link_to: <a href="/needs_index/">Needs Index</a>'
Then I should see 'explicit_link_to: <a href="/needs_index/index.html">Explicit</a>'
Then I should see 'unknown_link_to: <a href="/unknown.html">Unknown</a>'
Then I should see 'relative_link_to: <a href="/needs_index/">Relative</a>'
When I go to "/link_to/sub/"
Then I should see 'link_to: <a href="/needs_index/">Needs Index</a>'
Then I should see 'explicit_link_to: <a href="/needs_index/index.html">Explicit</a>'
Then I should see 'unknown_link_to: <a href="/unknown.html">Unknown</a>'
Then I should see 'relative_link_to: <a href="/needs_index/">Relative</a>'

View file

@ -1,46 +1,14 @@
Feature: Text Files Without Extensions Should Build and Preview
Scenario: Building Text Files without directory indexes
Given a fixture app "extensionless-text-files-app"
And a file named "config.rb" with:
"""
"""
And a successfully built app at "extensionless-text-files-app"
Given a successfully built app at "extensionless-text-files-app"
When I cd to "build"
Then the following files should exist:
| CNAME |
| LICENSE |
| README |
Scenario: Building Text Files with directory indexes
Given a fixture app "extensionless-text-files-app"
And a file named "config.rb" with:
"""
activate :directory_indexes
"""
And a successfully built app at "extensionless-text-files-app"
When I cd to "build"
Then the following files should exist:
| CNAME |
| LICENSE |
| README |
Then the following files should not exist:
| CNAME/index.html |
| LICENSE/index.html |
| README/index.html |
Scenario: Previewing Text Files without directory indexes
Given "directory_indexes" feature is "disabled"
Given the Server is running at "extensionless-text-files-app"
When I go to "/CNAME"
Then I should see "test.github.com"
When I go to "/LICENSE"
Then I should see "You have the right to remain classy."
When I go to "/README"
Then I should see "Bork bork bork"
Scenario: Previewing Text Files with directory indexes
Given "directory_indexes" feature is "enabled"
Scenario: Previewing Text Files
Given the Server is running at "extensionless-text-files-app"
When I go to "/CNAME"
Then I should see "test.github.com"

View file

@ -2,33 +2,24 @@ Feature: Setting page settings through frontmatter
Scenario: Setting layout, ignoring, and disabling directory indexes through frontmatter (build)
Given a successfully built app at "frontmatter-settings-app"
Then the following files should exist:
| build/proxied/index.html |
| build/no_index.html |
And the file "build/alternate_layout/index.html" should contain "Alternate layout"
| build/proxied.html |
And the file "build/alternate_layout.html" should contain "Alternate layout"
And the following files should not exist:
| build/ignored/index.html |
| build/no_index/index.html |
| build/ignored.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/"
When I go to "/alternate_layout.html"
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"
Scenario: Changing frontmatter in preview server
Given the Server is running at "frontmatter-settings-app"
When I go to "/ignored/index.html"
When I go to "/ignored.html"
Then I should see "File Not Found"
And the file "source/ignored.html.erb" has the contents
"""
@ -38,5 +29,5 @@ Feature: Setting page settings through frontmatter
This file is no longer ignored.
"""
When I go to "/ignored/index.html"
When I go to "/ignored.html"
Then I should see "This file is no longer ignored."

View file

@ -1,6 +0,0 @@
Feature: Lorem generating helper
Scenario: Lorem Helper
Given the Server is running at "lorem-app"
Then going to "/lorem.html" should not raise an exception
And I should see "http://placekitten.com/100"

View file

@ -45,24 +45,4 @@ Feature: relative_link_to helper
Then I should see 'unknown: <a href="foo.html">Unknown</a>'
When I go to "/link_to/sub.html"
Then I should see 'absolute: <a href="../needs_index.html">Needs Index</a>'
Then I should see 'relative: <a href="../needs_index.html">Relative</a>'
Scenario: relative_link_to knows about directory indexes
Given a fixture app "indexable-app"
And a file named "source/link_to.html.erb" with:
"""
absolute: <%= link_to "Needs Index", "/needs_index.html", :relative => true %>
relative: <%= link_to "Relative", "needs_index.html", :relative => true %>
"""
And a file named "source/link_to/sub.html.erb" with:
"""
absolute: <%= link_to "Needs Index", "/needs_index.html", :relative => true %>
relative: <%= link_to "Relative", "../needs_index.html", :relative => true %>
"""
And the Server is running at "indexable-app"
When I go to "/link_to/"
Then I should see 'absolute: <a href="needs_index/">Needs Index</a>'
Then I should see 'relative: <a href="needs_index/">Relative</a>'
When I go to "/link_to/sub/"
Then I should see 'absolute: <a href="../needs_index/">Needs Index</a>'
Then I should see 'relative: <a href="../needs_index/">Relative</a>'
Then I should see 'relative: <a href="../needs_index.html">Relative</a>'

View file

@ -118,81 +118,4 @@ Feature: Ignoring paths
When I go to "/reports/another.html"
Then I should see "File Not Found"
When I go to "/images/icons/messages.png"
Then I should see "File Not Found"
Scenario: Ignore with directory indexes (source file, build)
Given a fixture app "ignore-app"
And a file named "config.rb" with:
"""
activate :directory_indexes
ignore 'about.html.erb'
ignore 'plain.html'
"""
And a successfully built app at "ignore-app"
Then the following files should exist:
| build/index.html |
And the following files should not exist:
| build/about/index.html |
| build/plain/index.html |
Scenario: Ignore with directory indexes (source file, server)
Given a fixture app "ignore-app"
And a file named "config.rb" with:
"""
activate :directory_indexes
ignore 'about.html.erb'
ignore 'plain.html'
"""
And the Server is running
When I go to "/index.html"
Then I should not see "File Not Found"
When I go to "/about/index.html"
Then I should see "File Not Found"
When I go to "/plain/index.html"
Then I should see "File Not Found"
Scenario: Ignore with directory indexes (output path splat, build)
Given a fixture app "ignore-app"
And a file named "config.rb" with:
"""
activate :directory_indexes
ignore 'about*'
ignore 'plain*'
"""
And a successfully built app at "ignore-app"
Then the following files should exist:
| build/index.html |
And the following files should not exist:
| build/about/index.html |
| build/plain/index.html |
Scenario: Ignore with directory indexes (output path splat, server)
Given a fixture app "ignore-app"
And a file named "config.rb" with:
"""
activate :directory_indexes
ignore 'about*'
ignore 'plain*'
"""
And the Server is running
When I go to "/index.html"
Then I should not see "File Not Found"
When I go to "/about/index.html"
Then I should see "File Not Found"
When I go to "/plain/index.html"
Then I should see "File Not Found"
# Scenario: Ignore with directory indexes (output path index)
# Given a fixture app "ignore-app"
# And a file named "config.rb" with:
# """
# activate :directory_indexes
# ignore 'about/index.html'
# ignore 'plain/index.html'
# """
# And a successfully built app at "ignore-app"
# Then the following files should exist:
# | build/index.html |
# And the following files should not exist:
# | build/about/index.html |
# | build/plain/index.html |
Then I should see "File Not Found"

View file

@ -35,7 +35,7 @@ Feature: Step through sitemap as a tree
Scenario: Page has siblings, parent, and source file
Given the Server is running at "traversal-app"
When I go to "/sub/sibling/"
When I go to "/sub/sibling.html"
Then I should see "Parent: sub/index.html"
Then I should see "Sibling: sub/fake.html"
Then I should see "Sibling: sub/fake2.html"
@ -45,7 +45,7 @@ Feature: Step through sitemap as a tree
Scenario: Proxied page has siblings, parent, and source file
Given the Server is running at "traversal-app"
When I go to "/sub/fake/"
When I go to "/sub/fake.html"
Then I should see "Path: sub/fake.html"
Then I should see "Parent: sub/index.html"
Then I should see "Sibling: sub/fake2.html"
@ -56,13 +56,13 @@ Feature: Step through sitemap as a tree
Scenario: Child pages have data
Given the Server is running at "traversal-app"
When I go to "/directory-indexed"
When I go to "/directory-indexed.html"
Then I should see "Title of Sibling One"
Then I should see "Title of Sibling Two"
Scenario: When directory_index extension is active, child pages are found in named directory
Scenario: When directory_index extension is inactive, child pages are found in named directory
Given the Server is running at "traversal-app"
When I go to "/directory-indexed"
When I go to "/directory-indexed.html"
Then I should see "Path: directory-indexed.html"
Then I should see "Parent: index.html"
Then I should see "Child: directory-indexed/fake.html"

View file

@ -7,13 +7,4 @@ Feature: Wildcards in Page helper
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/"
Then I should see "Admin Layout"