Created
May 15, 2009 02:06
-
-
Save miketierney/112023 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def test_lists_files_and_directories | |
| io = StringIO.new("GET /test/ HTTP/1.0\r\n\r\n") | |
| body = "<html><head></head><body><ul style=\"list-style-type:none;margin:0;padding:0;\"><li>helper.rb</li><li>test.html</li><li>test.html.erb</li><li>test_pan_server.rb</li><li>test_pan_server_g.rb</li><li>test_pan_server_t_c_p.rb</li><li>test_request.rb</li><li>test_response.rb</li><li>test_router.rb</li></ul></body></html>" | |
| @router.accept(io) | |
| response = io.string.split("\r\n") | |
| assert response.include?('HTTP/0.9 200 OK'), 'should have 200 status code' | |
| assert response.include?('Content-Type: text/html'), "should have content type header" | |
| assert response.include?(body), "Shoud list all the files in the test directory." | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment