Implied extensions. Closes #304
This commit is contained in:
parent
aab9644185
commit
e769477e93
9 changed files with 102 additions and 19 deletions
|
@ -13,23 +13,23 @@ Feature: Text Files Without Extensions Should Build and Preview
|
|||
| LICENSE |
|
||||
| README |
|
||||
|
||||
Scenario: Building Text Files with directory indexes
|
||||
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 |
|
||||
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"
|
||||
|
|
52
middleman-core/features/implied_extensions.feature
Normal file
52
middleman-core/features/implied_extensions.feature
Normal file
|
@ -0,0 +1,52 @@
|
|||
Feature: Use default extensions when user doesn't supply them
|
||||
|
||||
Scenario: Default extensions preview
|
||||
Given the Server is running at "implied-extensions-app"
|
||||
When I go to "/index.html"
|
||||
Then I should see "hello: world"
|
||||
When I go to "/index.erb"
|
||||
Then I should see "File Not Found"
|
||||
When I go to "/index"
|
||||
Then I should see "File Not Found"
|
||||
|
||||
Scenario: Default extensions preview
|
||||
Given a fixture app "implied-extensions-app"
|
||||
And a file named "config.rb" with:
|
||||
"""
|
||||
template_extensions :erb => :htm
|
||||
"""
|
||||
And the Server is running
|
||||
When I go to "/index.htm"
|
||||
Then I should see "hello: world"
|
||||
When I go to "/index.erb"
|
||||
Then I should see "File Not Found"
|
||||
When I go to "/index"
|
||||
Then I should see "File Not Found"
|
||||
When I go to "/index.html"
|
||||
Then I should see "File Not Found"
|
||||
|
||||
Scenario: Default extensions build
|
||||
Given a fixture app "implied-extensions-app"
|
||||
And a successfully built app at "implied-extensions-app"
|
||||
When I cd to "build"
|
||||
Then the following files should exist:
|
||||
| index.html |
|
||||
Then the following files should not exist:
|
||||
| index |
|
||||
| index.erb |
|
||||
And the file "index.html" should contain "hello: world"
|
||||
|
||||
Scenario: Default extensions build with override
|
||||
Given a fixture app "implied-extensions-app"
|
||||
And a file named "config.rb" with:
|
||||
"""
|
||||
template_extensions :erb => :htm
|
||||
"""
|
||||
And a successfully built app at "implied-extensions-app"
|
||||
When I cd to "build"
|
||||
Then the following files should exist:
|
||||
| index.htm |
|
||||
Then the following files should not exist:
|
||||
| index |
|
||||
| index.erb |
|
||||
| index.html |
|
Loading…
Add table
Add a link
Reference in a new issue