middleman/middleman-more/features/directory_index.feature

67 lines
3.2 KiB
Gherkin
Raw Normal View History

Feature: Directory Index
In order output Apache-friendly directories and indexes
Scenario: Checking built folder for content
2011-12-16 01:36:57 +01:00
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 |
2011-12-16 01:36:57 +01:00
| regular/index.html |
| .htaccess |
2013-01-19 02:13:49 +01:00
| .htpasswd |
2011-12-16 01:36:57 +01:00
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 |
2011-12-16 01:36:57 +01:00
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>'