Demonstrate issue with directory indexes and spaces in paths

References #961
This commit is contained in:
Nicholas Hutchinson 2013-07-15 15:33:44 +01:00 committed by Ben Hollis
parent cd9964edbe
commit dcd760d4f8
2 changed files with 16 additions and 1 deletions

View file

@ -9,6 +9,7 @@ Feature: Directory Index
| a_folder/needs_index/index.html |
| leave_me_alone.html |
| wildcard_leave_me_alone.html |
| evil spaces/index.html |
| regular/index.html |
| .htaccess |
| .htpasswd |
@ -16,6 +17,7 @@ Feature: Directory Index
Then the following files should not exist:
| egular/index/index.html |
| needs_index.html |
| evil spaces.html |
| a_folder/needs_index.html |
| leave_me_alone/index.html |
| wildcard_leave_me_alone/index.html |
@ -23,12 +25,19 @@ Feature: Directory Index
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"
And the file "evil spaces/index.html" should contain "Spaces"
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 with spaces in filename
Given the Server is running at "indexable-app"
When I go to "/evil spaces/"
Then I should see "Spaces"
Scenario: Preview normal file subdirectory
Given the Server is running at "indexable-app"
When I go to "/a_folder/needs_index/"
@ -47,6 +56,7 @@ Feature: Directory Index
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" %>
link_to_with_spaces: <%= link_to "Spaces", "/evil%20spaces.html" %>
"""
And a file named "source/link_to/sub.html.erb" with:
"""
@ -54,6 +64,7 @@ Feature: Directory Index
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" %>
link_to_with_spaces: <%= link_to "Spaces", "../evil%20spaces.html" %>
"""
And the Server is running at "indexable-app"
When I go to "/link_to/"
@ -61,8 +72,11 @@ Feature: Directory Index
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>'
Then I should see 'link_to_with_spaces: <a href="/evil%20spaces/">Spaces</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>'
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>'

View file

@ -0,0 +1 @@
Spaces