From: Zachary Stevens Date: Sun, 6 Dec 2009 12:12:09 +0000 (+0000) Subject: Add tests for p param validation. X-Git-Tag: 0.000002~8^2~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b443902266ce358a690fa9deb28696d80db173c1;p=catagits%2FGitalist.git Add tests for p param validation. --- diff --git a/t/01app.t b/t/01app.t index 422e82a..a39a128 100644 --- a/t/01app.t +++ b/t/01app.t @@ -16,8 +16,12 @@ for my $p (qw/ repo1 nodescription /) { ok( request($path)->is_success, "$path should succeed"); } -is request('/summary?p=DoesNotExist')->code, 404, - '/summary?p=DoesNotExist 404s'; +my $response = request('/summary?p=DoesNotExist'); +is $response->code, 404, 'invalid project 404s'; +like $response->content, qr/Page not found/, 'invalid project handled correctly'; + +is request('/summary?p=../../../')->code, 404, 'directory traversal failed'; + { # URI tests for repo1 local *test = curry_test_uri('repo1');