Skip to content

Commit

Permalink
Test readme upload
Browse files Browse the repository at this point in the history
  • Loading branch information
kureuil committed Jul 9, 2017
1 parent 5afd31c commit 275548b
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
42 changes: 42 additions & 0 deletions src/tests/http-data/krate_new_krate_with_readme
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
===REQUEST 345
PUT http://alexcrichton-test.s3.amazonaws.com/crates/foo_readme/foo_readme-1.0.0.crate HTTP/1.1
Accept: */*
Proxy-Connection: Keep-Alive
Authorization: AWS AKIAJF3GEK7N44BACDZA:GDxGb6r3SIqo9wXuzHrgMNWekwk=
Content-Length: 0
Host: alexcrichton-test.s3.amazonaws.com
Content-Type: application/x-tar
Date: Sun, 28 Jun 2015 14:07:17 -0700


===RESPONSE 258
HTTP/1.1 200
x-amz-request-id: CB0E925D8E3AB3E8
x-amz-id-2: SiaMwszM1p2TzXlLauvZ6kRKcUCg7HoyBW29vts42w9ArrLwkJWl8vuvPuGFkpM6XGH+YXN852g=
date: Sun, 28 Jun 2015 21:07:51 GMT
etag: "d41d8cd98f00b204e9800998ecf8427e"
content-length: 0
server: AmazonS3


===REQUEST 337
PUT http://alexcrichton-test.s3.amazonaws.com/readmes/foo_readme/foo_readme-1.0.0.html HTTP/1.1
Accept: */*
Proxy-Connection: Keep-Alive
Authorization: AWS AKIAJF3GEK7N44BACDZA:GDxGb6r3SIqo9wXuzHrgMNWekwk=
Content-Length: 0
Host: alexcrichton-test.s3.amazonaws.com
Content-Type: text/html
Date: Sun, 28 Jun 2015 14:07:17 -0700


===RESPONSE 258
HTTP/1.1 200
x-amz-request-id: CB0E925D8E3AB3E8
x-amz-id-2: SiaMwszM1p2TzXlLauvZ6kRKcUCg7HoyBW29vts42w9ArrLwkJWl8vuvPuGFkpM6XGH+YXN852g=
date: Sun, 28 Jun 2015 21:07:51 GMT
etag: "d41d8cd98f00b204e9800998ecf8427e"
content-length: 0
server: AmazonS3


13 changes: 13 additions & 0 deletions src/tests/krate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,19 @@ fn new_krate_dependency_missing() {
));
}

#[test]
fn new_krate_with_readme() {
let (_b, app, middle) = ::app();
let mut krate = ::krate("foo_readme");
krate.readme = Some("".to_owned());
let mut req = ::new_req_full(app.clone(), krate, "1.0.0", vec![]);
::sign_in(&mut req, &app);
let mut response = ok_resp!(middle.call(&mut req));
let json: GoodCrate = ::json(&mut response);
assert_eq!(json.krate.name, "foo_readme");
assert_eq!(json.krate.max_version, "1.0.0");
}

#[test]
fn summary_doesnt_die() {
let (_b, app, middle) = ::app();
Expand Down

0 comments on commit 275548b

Please sign in to comment.