2011-07-27 22:59:38 -04:00
|
|
|
Feature: Directory Index
|
|
|
|
In order output Apache-friendly directories and indexes
|
|
|
|
|
|
|
|
Scenario: Checking built folder for content
|
2011-12-15 19:36:57 -05: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 |
|
2012-03-15 03:29:50 -04:00
|
|
|
| wildcard_leave_me_alone.html |
|
2016-01-10 19:56:18 -05:00
|
|
|
| regex_leave_me_alone2.html |
|
2013-07-15 10:33:44 -04:00
|
|
|
| evil spaces/index.html |
|
2011-12-15 19:36:57 -05:00
|
|
|
| regular/index.html |
|
|
|
|
| .htaccess |
|
2013-01-18 20:13:49 -05:00
|
|
|
| .htpasswd |
|
2013-06-30 18:45:49 -04:00
|
|
|
| .nojekyll |
|
2011-12-15 19:36:57 -05:00
|
|
|
Then the following files should not exist:
|
|
|
|
| egular/index/index.html |
|
|
|
|
| needs_index.html |
|
2013-07-15 10:33:44 -04:00
|
|
|
| evil spaces.html |
|
2011-12-15 19:36:57 -05:00
|
|
|
| a_folder/needs_index.html |
|
|
|
|
| leave_me_alone/index.html |
|
2012-03-15 03:29:50 -04:00
|
|
|
| wildcard_leave_me_alone/index.html |
|
2016-01-10 19:56:18 -05:00
|
|
|
| regex_leave_me_alone2/index.html |
|
2011-12-15 19:36:57 -05: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"
|
2014-11-19 13:39:48 -05:00
|
|
|
And the file "evil spaces/index.html" should contain "Filled with Evil Spaces"
|
2016-01-10 19:56:18 -05:00
|
|
|
|
2011-07-27 22:59:38 -04:00
|
|
|
Scenario: Preview normal file
|
|
|
|
Given the Server is running at "indexable-app"
|
|
|
|
When I go to "/needs_index/"
|
|
|
|
Then I should see "Indexable"
|
2013-09-22 17:36:00 -04:00
|
|
|
|
2013-07-15 10:33:44 -04:00
|
|
|
Scenario: Preview normal file with spaces in filename
|
|
|
|
Given the Server is running at "indexable-app"
|
2014-11-19 13:39:48 -05:00
|
|
|
When I go to "/evil spaces/"
|
|
|
|
Then I should see "Filled with Evil Spaces"
|
2013-07-15 10:33:44 -04:00
|
|
|
|
2011-07-27 22:59:38 -04:00
|
|
|
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"
|
2013-09-22 17:36:00 -04:00
|
|
|
|
2011-07-27 22:59:38 -04:00
|
|
|
Scenario: Preview ignored file
|
|
|
|
Given the Server is running at "indexable-app"
|
|
|
|
When I go to "/leave_me_alone/"
|
2012-04-28 01:05:52 -04:00
|
|
|
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" %>
|
2013-07-15 10:33:44 -04:00
|
|
|
link_to_with_spaces: <%= link_to "Spaces", "/evil%20spaces.html" %>
|
2012-04-28 01:05:52 -04:00
|
|
|
"""
|
2012-05-19 16:28:59 -04:00
|
|
|
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" %>
|
2013-07-15 10:33:44 -04:00
|
|
|
link_to_with_spaces: <%= link_to "Spaces", "../evil%20spaces.html" %>
|
2012-05-19 16:28:59 -04:00
|
|
|
"""
|
2012-04-28 01:05:52 -04:00
|
|
|
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>'
|
2013-09-22 17:36:00 -04:00
|
|
|
Then I should see 'explicit_link_to: <a href="/needs_index/">Explicit</a>'
|
2012-04-28 01:05:52 -04:00
|
|
|
Then I should see 'unknown_link_to: <a href="/unknown.html">Unknown</a>'
|
2012-05-19 16:28:59 -04:00
|
|
|
Then I should see 'relative_link_to: <a href="/needs_index/">Relative</a>'
|
2013-07-15 10:33:44 -04:00
|
|
|
Then I should see 'link_to_with_spaces: <a href="/evil%20spaces/">Spaces</a>'
|
2012-05-19 16:28:59 -04:00
|
|
|
When I go to "/link_to/sub/"
|
|
|
|
Then I should see 'link_to: <a href="/needs_index/">Needs Index</a>'
|
2013-09-22 17:36:00 -04:00
|
|
|
Then I should see 'explicit_link_to: <a href="/needs_index/">Explicit</a>'
|
2012-05-19 16:28:59 -04:00
|
|
|
Then I should see 'unknown_link_to: <a href="/unknown.html">Unknown</a>'
|
2013-07-15 10:33:44 -04:00
|
|
|
Then I should see 'relative_link_to: <a href="/needs_index/">Relative</a>'
|
|
|
|
Then I should see 'link_to_with_spaces: <a href="/evil%20spaces/">Spaces</a>'
|