diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2018-08-30 19:21:08 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2018-08-30 19:21:08 -0700 |
commit | 43cb2cdcd3dae5e054f093120940b9aa1e09718a (patch) | |
tree | ad3ed775c87ef0ee11ab62d4a46ca663918fdc0d /rust/tests/test_api_server.rs | |
parent | cc11d5000910b5fd53e40bfd01056c0db60c35aa (diff) | |
download | fatcat-43cb2cdcd3dae5e054f093120940b9aa1e09718a.tar.gz fatcat-43cb2cdcd3dae5e054f093120940b9aa1e09718a.zip |
minimal autoaccept tests
Diffstat (limited to 'rust/tests/test_api_server.rs')
-rw-r--r-- | rust/tests/test_api_server.rs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/rust/tests/test_api_server.rs b/rust/tests/test_api_server.rs index 02c77413..340fb996 100644 --- a/rust/tests/test_api_server.rs +++ b/rust/tests/test_api_server.rs @@ -918,3 +918,44 @@ fn test_contribs() { None, ); } + +#[test] +fn test_post_batch_autoaccept() { + let (headers, router, _conn) = setup(); + + // "true" + check_response( + request::post( + "http://localhost:9411/v0/container/batch?autoaccept=true", + headers.clone(), + r#"[{"name": "test journal"}, {"name": "another test journal"}]"#, + &router, + ), + status::Created, + None, + ); + + // "n" + check_response( + request::post( + "http://localhost:9411/v0/container/batch?autoaccept=n", + headers.clone(), + r#"[{"name": "test journal"}, {"name": "another test journal"}]"#, + &router, + ), + status::Created, + None, + ); + + // editgroup + check_response( + request::post( + "http://localhost:9411/v0/container/batch?autoaccept=yes&editgroup=asdf", + headers.clone(), + r#"[{"name": "test journal"}, {"name": "another test journal"}]"#, + &router, + ), + status::BadRequest, + None, + ); +} |