Skip to content

Commit 61f6431

Browse files
committed
Test readme upload
1 parent 14e6b3e commit 61f6431

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
===REQUEST 345
2+
PUT http://alexcrichton-test.s3.amazonaws.com/crates/foo_readme/foo_readme-1.0.0.crate HTTP/1.1
3+
Accept: */*
4+
Proxy-Connection: Keep-Alive
5+
Authorization: AWS AKIAJF3GEK7N44BACDZA:GDxGb6r3SIqo9wXuzHrgMNWekwk=
6+
Content-Length: 0
7+
Host: alexcrichton-test.s3.amazonaws.com
8+
Content-Type: application/x-tar
9+
Date: Sun, 28 Jun 2015 14:07:17 -0700
10+
11+
12+
===RESPONSE 258
13+
HTTP/1.1 200
14+
x-amz-request-id: CB0E925D8E3AB3E8
15+
x-amz-id-2: SiaMwszM1p2TzXlLauvZ6kRKcUCg7HoyBW29vts42w9ArrLwkJWl8vuvPuGFkpM6XGH+YXN852g=
16+
date: Sun, 28 Jun 2015 21:07:51 GMT
17+
etag: "d41d8cd98f00b204e9800998ecf8427e"
18+
content-length: 0
19+
server: AmazonS3
20+
21+
22+
===REQUEST 337
23+
PUT http://alexcrichton-test.s3.amazonaws.com/readmes/foo_readme/foo_readme-1.0.0.html HTTP/1.1
24+
Accept: */*
25+
Proxy-Connection: Keep-Alive
26+
Authorization: AWS AKIAJF3GEK7N44BACDZA:GDxGb6r3SIqo9wXuzHrgMNWekwk=
27+
Content-Length: 0
28+
Host: alexcrichton-test.s3.amazonaws.com
29+
Content-Type: text/html
30+
Date: Sun, 28 Jun 2015 14:07:17 -0700
31+
32+
33+
===RESPONSE 258
34+
HTTP/1.1 200
35+
x-amz-request-id: CB0E925D8E3AB3E8
36+
x-amz-id-2: SiaMwszM1p2TzXlLauvZ6kRKcUCg7HoyBW29vts42w9ArrLwkJWl8vuvPuGFkpM6XGH+YXN852g=
37+
date: Sun, 28 Jun 2015 21:07:51 GMT
38+
etag: "d41d8cd98f00b204e9800998ecf8427e"
39+
content-length: 0
40+
server: AmazonS3
41+
42+

src/tests/krate.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,19 @@ fn new_krate_dependency_missing() {
10001000
));
10011001
}
10021002

1003+
#[test]
1004+
fn new_krate_with_readme() {
1005+
let (_b, app, middle) = ::app();
1006+
let mut krate = ::krate("foo_readme");
1007+
krate.readme = Some("".to_owned());
1008+
let mut req = ::new_req_full(app.clone(), krate, "1.0.0", vec![]);
1009+
::sign_in(&mut req, &app);
1010+
let mut response = ok_resp!(middle.call(&mut req));
1011+
let json: GoodCrate = ::json(&mut response);
1012+
assert_eq!(json.krate.name, "foo_readme");
1013+
assert_eq!(json.krate.max_version, "1.0.0");
1014+
}
1015+
10031016
#[test]
10041017
fn summary_doesnt_die() {
10051018
let (_b, app, middle) = ::app();

0 commit comments

Comments
 (0)