aboutsummaryrefslogtreecommitdiffstats
path: root/rust
diff options
context:
space:
mode:
Diffstat (limited to 'rust')
-rw-r--r--rust/tests/test_api_server.rs41
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,
+ );
+}