Skip to content

Commit e5ace68

Browse files
committed
more tests and cleanup
1 parent cfb23d5 commit e5ace68

10 files changed

+764
-376
lines changed

src/bin/migrate.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,6 @@ fn migrations() -> Vec<Migration> {
459459
login VARCHAR NOT NULL UNIQUE,
460460
github_id INTEGER NOT NULL UNIQUE,
461461
name VARCHAR,
462-
url VARCHAR,
463462
avatar VARCHAR
464463
"),
465464
Migration::run(20150804170129,

src/owner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ impl Team {
159159

160160
let stmt = try!(conn.prepare("INSERT INTO teams
161161
(login, github_id, name, avatar)
162-
VALUES ($1, $2, $3, $5)
162+
VALUES ($1, $2, $3, $4)
163163
RETURNING *"));
164164

165165
let rows = try!(stmt.query(&[&login, &github_id, &name, &avatar]));

src/tests/http-data/team_change_owners renamed to src/tests/http-data/team_add_owners_as_team_owner

Lines changed: 85 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -3,155 +3,155 @@ GET http://api.github.com/orgs/crates-test-org/teams HTTP/1.1
33
Host: api.github.com
44
Proxy-Connection: Keep-Alive
55
Accept: application/vnd.github.v3+json
6-
Authorization: token c26185f31a0c14681a82764124bd031e9e9bccb0
6+
Authorization: token e6d126e00feb3960bd52506092497e1a59d15263
77
User-Agent: hello!
88

99

10-
===RESPONSE 1978
10+
===RESPONSE 1995
1111
HTTP/1.1 200
12-
x-oauth-client-id: 89b6afdeaa6c6c7506ec
13-
x-xss-protection: 1; mode=block
1412
access-control-allow-origin: *
15-
x-github-request-id: 3FF5DB35:5BA8:BD4A9D6:55D26E98
16-
status: 200 OK
17-
server: GitHub.com
18-
access-control-expose-headers: ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
19-
content-length: 835
2013
x-oauth-scopes: read:org
21-
access-control-allow-credentials: true
14+
date: Tue, 18 Aug 2015 00:18:47 GMT
15+
content-length: 852
16+
x-ratelimit-reset: 1439860497
17+
etag: "c5a75e367565d032956a3cedfe950504"
2218
x-github-media-type: github.v3; format=json
23-
x-ratelimit-remaining: 4963
24-
vary: Accept, Authorization, Cookie, X-GitHub-OTP
25-
vary: Accept-Encoding
26-
cache-control: private, max-age=60, s-maxage=60
27-
x-content-type-options: nosniff
19+
content-security-policy: default-src 'none'
20+
access-control-allow-credentials: true
2821
x-accepted-oauth-scopes: admin:org, read:org, repo, user, write:org
29-
strict-transport-security: max-age=31536000; includeSubdomains; preload
30-
etag: "a2d2e8a3bf29134386bfe28cd588d1fd"
31-
date: Mon, 17 Aug 2015 23:30:32 GMT
22+
x-oauth-client-id: 89b6afdeaa6c6c7506ec
3223
x-frame-options: deny
33-
x-served-by: 2811da37fbdda4367181b328b22b2499
34-
x-ratelimit-reset: 1439854867
24+
status: 200 OK
3525
content-type: application/json; charset=utf-8
36-
content-security-policy: default-src 'none'
26+
x-ratelimit-remaining: 4953
27+
cache-control: private, max-age=60, s-maxage=60
28+
strict-transport-security: max-age=31536000; includeSubdomains; preload
3729
x-ratelimit-limit: 5000
30+
x-served-by: 474556b853193c38f1b14328ce2d1b7d
31+
x-content-type-options: nosniff
32+
vary: Accept, Authorization, Cookie, X-GitHub-OTP
33+
vary: Accept-Encoding
34+
server: GitHub.com
35+
access-control-expose-headers: ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
36+
x-github-request-id: 3FF5DB35:3D4C:9D6B6FD:55D279E7
37+
x-xss-protection: 1; mode=block
3838

39-
[{"name":"Owners","id":1699377,"slug":"owners","description":null,"permission":"admin","url":"https://api.github.com/teams/1699377","members_url":"https://api.github.com/teams/1699377/members{/member}","repositories_url":"https://api.github.com/teams/1699377/repos"},{"name":"just-for-crates-2","id":1699379,"slug":"just-for-crates-2","description":"","permission":"pull","url":"https://api.github.com/teams/1699379","members_url":"https://api.github.com/teams/1699379/members{/member}","repositories_url":"https://api.github.com/teams/1699379/repos"},{"name":"just-for-crates1","id":1699378,"slug":"just-for-crates1","description":"","permission":"pull","url":"https://api.github.com/teams/1699378","members_url":"https://api.github.com/teams/1699378/members{/member}","repositories_url":"https://api.github.com/teams/1699378/repos"}]
39+
[{"name":"Owners","id":1699377,"slug":"owners","description":null,"permission":"admin","url":"https://api.github.com/teams/1699377","members_url":"https://api.github.com/teams/1699377/members{/member}","repositories_url":"https://api.github.com/teams/1699377/repos"},{"name":"just-for-crates-2","id":1699379,"slug":"just-for-crates-2","description":"Just for Crates 2","permission":"pull","url":"https://api.github.com/teams/1699379","members_url":"https://api.github.com/teams/1699379/members{/member}","repositories_url":"https://api.github.com/teams/1699379/repos"},{"name":"just-for-crates1","id":1699378,"slug":"just-for-crates1","description":"","permission":"pull","url":"https://api.github.com/teams/1699378","members_url":"https://api.github.com/teams/1699378/members{/member}","repositories_url":"https://api.github.com/teams/1699378/repos"}]
4040
===REQUEST 255
4141
GET http://api.github.com/teams/1699377/memberships/crates-tester-2 HTTP/1.1
4242
Host: api.github.com
4343
Proxy-Connection: Keep-Alive
4444
User-Agent: hello!
45+
Authorization: token e6d126e00feb3960bd52506092497e1a59d15263
4546
Accept: application/vnd.github.v3+json
46-
Authorization: token c26185f31a0c14681a82764124bd031e9e9bccb0
4747

4848

4949
===RESPONSE 1227
5050
HTTP/1.1 200
51-
server: GitHub.com
52-
strict-transport-security: max-age=31536000; includeSubdomains; preload
53-
x-ratelimit-remaining: 4962
54-
date: Mon, 17 Aug 2015 23:30:33 GMT
55-
access-control-expose-headers: ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
5651
access-control-allow-origin: *
57-
status: 200 OK
58-
x-xss-protection: 1; mode=block
52+
x-served-by: 8dd185e423974a7e13abbbe6e060031e
53+
cache-control: private, max-age=60, s-maxage=60
54+
content-type: application/json; charset=utf-8
5955
vary: Accept, Authorization, Cookie, X-GitHub-OTP
6056
vary: Accept-Encoding
61-
x-ratelimit-reset: 1439854867
57+
content-security-policy: default-src 'none'
58+
x-oauth-client-id: 89b6afdeaa6c6c7506ec
59+
etag: "c43e7230d4c92c2a6369014be0d352d3"
60+
x-xss-protection: 1; mode=block
61+
strict-transport-security: max-age=31536000; includeSubdomains; preload
62+
x-content-type-options: nosniff
63+
x-ratelimit-remaining: 4952
64+
date: Tue, 18 Aug 2015 00:18:48 GMT
65+
x-accepted-oauth-scopes: admin:org, read:org, repo, write:org
66+
x-github-request-id: 3FF5DB35:3D4B:D10AA8A:55D279E8
67+
x-ratelimit-reset: 1439860497
68+
server: GitHub.com
6269
x-oauth-scopes: read:org
63-
content-type: application/json; charset=utf-8
70+
access-control-expose-headers: ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
71+
x-github-media-type: github.v3; format=json
72+
status: 200 OK
6473
x-frame-options: deny
65-
access-control-allow-credentials: true
66-
x-github-request-id: 3FF5DB35:5BAB:9BBCC53:55D26E99
67-
x-content-type-options: nosniff
6874
x-ratelimit-limit: 5000
6975
content-length: 91
70-
etag: "509aaf932a83319c5fc88ecce550f115"
71-
x-accepted-oauth-scopes: admin:org, read:org, repo, write:org
72-
cache-control: private, max-age=60, s-maxage=60
73-
content-security-policy: default-src 'none'
74-
x-served-by: 318e55760cf7cdb40e61175a4d36cd32
75-
x-oauth-client-id: 89b6afdeaa6c6c7506ec
76-
x-github-media-type: github.v3; format=json
76+
access-control-allow-credentials: true
7777

7878
{"state":"active","url":"https://api.github.com/teams/1699377/memberships/crates-tester-2"}
7979
===REQUEST 234
8080
GET http://api.github.com/orgs/crates-test-org HTTP/1.1
8181
Host: api.github.com
8282
Proxy-Connection: Keep-Alive
83-
Accept: application/vnd.github.v3+json
84-
Authorization: token c26185f31a0c14681a82764124bd031e9e9bccb0
8583
User-Agent: hello!
84+
Accept: application/vnd.github.v3+json
85+
Authorization: token e6d126e00feb3960bd52506092497e1a59d15263
8686

8787

8888
===RESPONSE 2079
8989
HTTP/1.1 200
90-
date: Mon, 17 Aug 2015 23:30:33 GMT
91-
etag: "f2fb21ecd1395923a51ab6ff4c85e0d1"
92-
x-ratelimit-remaining: 4961
90+
x-github-media-type: github.v3; format=json
91+
x-xss-protection: 1; mode=block
9392
x-content-type-options: nosniff
94-
access-control-expose-headers: ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
95-
content-security-policy: default-src 'none'
96-
strict-transport-security: max-age=31536000; includeSubdomains; preload
93+
cache-control: private, max-age=60, s-maxage=60
94+
x-accepted-oauth-scopes: admin:org, read:org, repo, user, write:org
95+
x-ratelimit-limit: 5000
9796
server: GitHub.com
98-
x-frame-options: deny
99-
x-oauth-scopes: read:org
97+
x-served-by: 318e55760cf7cdb40e61175a4d36cd32
98+
access-control-expose-headers: ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
99+
x-ratelimit-remaining: 4951
100+
etag: "fed47c4a794f484872c57aaeaff7feac"
101+
last-modified: Mon, 17 Aug 2015 23:27:29 GMT
100102
access-control-allow-credentials: true
103+
content-type: application/json; charset=utf-8
101104
access-control-allow-origin: *
102-
x-github-media-type: github.v3; format=json
105+
strict-transport-security: max-age=31536000; includeSubdomains; preload
106+
x-oauth-client-id: 89b6afdeaa6c6c7506ec
107+
x-oauth-scopes: read:org
108+
status: 200 OK
109+
x-github-request-id: 3FF5DB35:3D4B:D10AB34:55D279E8
110+
x-frame-options: deny
111+
date: Tue, 18 Aug 2015 00:18:48 GMT
112+
x-ratelimit-reset: 1439860497
113+
content-security-policy: default-src 'none'
103114
content-length: 890
104-
last-modified: Mon, 17 Aug 2015 23:27:29 GMT
105-
x-served-by: 173530fed4bbeb1e264b2ed22e8b5c20
106-
x-github-request-id: 3FF5DB35:5BAA:CE23A2A:55D26E99
107115
vary: Accept, Authorization, Cookie, X-GitHub-OTP
108116
vary: Accept-Encoding
109-
x-ratelimit-limit: 5000
110-
x-oauth-client-id: 89b6afdeaa6c6c7506ec
111-
cache-control: private, max-age=60, s-maxage=60
112-
x-xss-protection: 1; mode=block
113-
x-accepted-oauth-scopes: admin:org, read:org, repo, user, write:org
114-
x-ratelimit-reset: 1439854867
115-
status: 200 OK
116-
content-type: application/json; charset=utf-8
117117

118118
{"login":"crates-test-org","id":13804222,"url":"https://api.github.com/orgs/crates-test-org","repos_url":"https://api.github.com/orgs/crates-test-org/repos","events_url":"https://api.github.com/orgs/crates-test-org/events","members_url":"https://api.github.com/orgs/crates-test-org/members{/member}","public_members_url":"https://api.github.com/orgs/crates-test-org/public_members{/member}","avatar_url":"https://avatars.githubusercontent.com/u/13804222?v=3","description":null,"public_repos":0,"public_gists":0,"followers":0,"following":0,"html_url":"https://github.com/crates-test-org","created_at":"2015-08-15T00:07:30Z","updated_at":"2015-08-17T23:27:29Z","type":"Organization","total_private_repos":0,"owned_private_repos":0,"private_gists":0,"disk_usage":0,"collaborators":0,"billing_email":"[email protected]","plan":{"name":"free","space":976562499,"private_repos":0}}
119119
===REQUEST 255
120120
GET http://api.github.com/teams/1699377/memberships/crates-tester-1 HTTP/1.1
121121
Host: api.github.com
122122
Proxy-Connection: Keep-Alive
123-
Accept: application/vnd.github.v3+json
124-
Authorization: token 182fffe47c4c81843df6cac370bace828beab3bd
123+
Authorization: token e5452e00fd329a8acddce59aabc4bf95abf276a0
125124
User-Agent: hello!
125+
Accept: application/vnd.github.v3+json
126126

127127

128128
===RESPONSE 1227
129129
HTTP/1.1 200
130-
x-xss-protection: 1; mode=block
131-
date: Mon, 17 Aug 2015 23:30:34 GMT
130+
status: 200 OK
131+
x-github-media-type: github.v3; format=json
132+
x-ratelimit-limit: 5000
133+
access-control-expose-headers: ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
134+
strict-transport-security: max-age=31536000; includeSubdomains; preload
132135
x-oauth-scopes: read:org
133-
x-ratelimit-reset: 1439854847
136+
content-type: application/json; charset=utf-8
137+
content-length: 91
138+
x-github-request-id: 3FF5DB35:3D4C:9D6B86B:55D279E8
139+
date: Tue, 18 Aug 2015 00:18:49 GMT
140+
etag: "f6ec304b608781ecc639b246dea422ef"
134141
vary: Accept, Authorization, Cookie, X-GitHub-OTP
135142
vary: Accept-Encoding
136143
access-control-allow-origin: *
137-
x-accepted-oauth-scopes: admin:org, read:org, repo, write:org
138-
cache-control: private, max-age=60, s-maxage=60
144+
server: GitHub.com
145+
x-ratelimit-remaining: 4986
139146
x-oauth-client-id: 89b6afdeaa6c6c7506ec
140-
x-github-request-id: 3FF5DB35:5BAA:CE23AF8:55D26E99
141147
access-control-allow-credentials: true
142-
x-content-type-options: nosniff
143-
content-length: 91
144-
x-github-media-type: github.v3; format=json
145-
content-type: application/json; charset=utf-8
146-
x-ratelimit-limit: 5000
147-
strict-transport-security: max-age=31536000; includeSubdomains; preload
148-
access-control-expose-headers: ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
149-
content-security-policy: default-src 'none'
150-
x-served-by: 5aeb3f30c9e3ef6ef7bcbcddfd9a68f7
148+
x-xss-protection: 1; mode=block
151149
x-frame-options: deny
152-
x-ratelimit-remaining: 4987
153-
etag: "9b80735a87afe3085f2354327aabd309"
154-
server: GitHub.com
155-
status: 200 OK
150+
x-accepted-oauth-scopes: admin:org, read:org, repo, write:org
151+
x-ratelimit-reset: 1439860516
152+
x-served-by: a7f8a126c9ed3f1c4715a34c0ddc7290
153+
cache-control: private, max-age=60, s-maxage=60
154+
content-security-policy: default-src 'none'
155+
x-content-type-options: nosniff
156156

157157
{"state":"active","url":"https://api.github.com/teams/1699377/memberships/crates-tester-1"}

0 commit comments

Comments
 (0)