diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2018-12-31 18:05:24 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2018-12-31 18:05:26 -0800 |
commit | 42ffee8c583729287aed7eaa6df4b7b121c1f7f6 (patch) | |
tree | 40afc986b07d6af1f04913b43c20e81dfe38d22a /rust/tests/test_api_server_http.rs | |
parent | 48379975135f470f7e2faac6423c6188e3798b2d (diff) | |
download | fatcat-42ffee8c583729287aed7eaa6df4b7b121c1f7f6.tar.gz fatcat-42ffee8c583729287aed7eaa6df4b7b121c1f7f6.zip |
make editor_id optional when createding editgroup
The editor_id can be infered from auth metadata.
Diffstat (limited to 'rust/tests/test_api_server_http.rs')
-rw-r--r-- | rust/tests/test_api_server_http.rs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/rust/tests/test_api_server_http.rs b/rust/tests/test_api_server_http.rs index 2160a0a0..d975fe6e 100644 --- a/rust/tests/test_api_server_http.rs +++ b/rust/tests/test_api_server_http.rs @@ -1545,3 +1545,36 @@ fn test_release_types() { Some("release_type"), ); } + +#[test] +fn test_create_editgroup() { + let (headers, router, _conn) = setup_http(); + + // We're authenticated, so don't need to supply editor_id + check_http_response( + request::post( + &format!( + "http://localhost:9411/v0/editgroup", + ), + headers.clone(), + "{}", + &router, + ), + status::Created, + None, + ); + + // But can if we want to + check_http_response( + request::post( + &format!( + "http://localhost:9411/v0/editgroup", + ), + headers.clone(), + r#"{"editor_id": "aaaaaaaaaaaabkvkaaaaaaaaae"}"#, + &router, + ), + status::Created, + None, + ); +} |