summaryrefslogtreecommitdiffstats
path: root/rust/tests
diff options
context:
space:
mode:
Diffstat (limited to 'rust/tests')
-rw-r--r--rust/tests/test_api_server_http.rs33
-rw-r--r--rust/tests/test_old_python_tests.rs7
2 files changed, 38 insertions, 2 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,
+ );
+}
diff --git a/rust/tests/test_old_python_tests.rs b/rust/tests/test_old_python_tests.rs
index 1f91c7db..afeff55e 100644
--- a/rust/tests/test_old_python_tests.rs
+++ b/rust/tests/test_old_python_tests.rs
@@ -22,7 +22,8 @@ fn test_api_rich_create() {
let admin_id = "aaaaaaaaaaaabkvkaaaaaaaaae".to_string();
- let mut new_eg = Editgroup::new(admin_id);
+ let mut new_eg = Editgroup::new();
+ new_eg.editor_id = Some(admin_id);
new_eg.description = Some("a unit test edit".to_string());
let resp = client.create_editgroup(new_eg).wait().unwrap();
let editgroup_id = match resp {
@@ -196,8 +197,10 @@ fn test_merge_works() {
let admin_id = "aaaaaaaaaaaabkvkaaaaaaaaae".to_string();
+ let mut eg = Editgroup::new();
+ eg.editor_id = Some(admin_id);
let resp = client
- .create_editgroup(Editgroup::new(admin_id))
+ .create_editgroup(eg)
.wait()
.unwrap();
let editgroup_id = match resp {