Skip to content

Commit

Permalink
Tests for receive-pack-advertisement
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremySkinner committed Jun 23, 2010
1 parent f913702 commit 865b989
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions GitAspx.Tests/MainTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ public void Gets_upload_pack_advertisement() {
body.ShouldContain("multi_ack_detailed");
}

[Test]
public void Gets_receive_pack_advertisement() {
var response = Get("/test/info/refs?service=git-receive-pack");
response.StatusCode.ShouldEqual(HttpStatusCode.OK);
response.Headers["Content-Type"].ShouldContain("application/x-git-receive-pack-advertisement");

var body = response.GetString();
body.SplitOnNewLine()[0].ShouldEqual("001F# service=git-receive-pack");
body.ShouldContain("0000007314bf0836c3371b740ebad55fbda6223bd7940f20 refs/heads/master");
body.ShouldContain("report-status");
body.ShouldContain("delete-refs");
body.ShouldContain("ofs-delta");
}

[Test]
public void NoAccess_to_UploadPack_when_incorrect_content_type() {
var response = Post("test/git-upload-pack");
Expand Down

0 comments on commit 865b989

Please sign in to comment.