aboutsummaryrefslogtreecommitdiffstats
path: root/rust/tests/test_api_server_http.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-01-09 13:18:38 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-01-09 13:18:38 -0800
commit17fe81ea8d58f93f129492dc44a38df9ab8d528e (patch)
tree3d4cb71fb5d2b1c3d15c6cfcf348f09a51b13543 /rust/tests/test_api_server_http.rs
parent0624fce632da17b3f98f0d4ff98a736f05fa287b (diff)
downloadfatcat-17fe81ea8d58f93f129492dc44a38df9ab8d528e.tar.gz
fatcat-17fe81ea8d58f93f129492dc44a38df9ab8d528e.zip
rust impl required editgroup_id
Diffstat (limited to 'rust/tests/test_api_server_http.rs')
-rw-r--r--rust/tests/test_api_server_http.rs60
1 files changed, 48 insertions, 12 deletions
diff --git a/rust/tests/test_api_server_http.rs b/rust/tests/test_api_server_http.rs
index e82037f0..7d4469af 100644
--- a/rust/tests/test_api_server_http.rs
+++ b/rust/tests/test_api_server_http.rs
@@ -538,7 +538,10 @@ fn test_post_file() {
helpers::check_http_response(
request::post(
- &format!("http://localhost:9411/v0/file?editgroup_id={}", editgroup_id),
+ &format!(
+ "http://localhost:9411/v0/file?editgroup_id={}",
+ editgroup_id
+ ),
headers.clone(),
r#"{ }"#,
&router,
@@ -605,7 +608,10 @@ fn test_post_fileset() {
helpers::check_http_response(
request::post(
- &format!("http://localhost:9411/v0/fileset?editgroup_id={}", editgroup_id),
+ &format!(
+ "http://localhost:9411/v0/fileset?editgroup_id={}",
+ editgroup_id
+ ),
headers.clone(),
r#"{ }"#,
&router,
@@ -662,7 +668,10 @@ fn test_post_webcapture() {
helpers::check_http_response(
request::post(
- &format!("http://localhost:9411/v0/webcapture?editgroup_id={}", editgroup_id),
+ &format!(
+ "http://localhost:9411/v0/webcapture?editgroup_id={}",
+ editgroup_id
+ ),
headers.clone(),
r#"{ "original_url": "https://fatcat.wiki",
"timestamp": "2018-12-28T11:11:11Z" }"#,
@@ -674,7 +683,10 @@ fn test_post_webcapture() {
helpers::check_http_response(
request::post(
- &format!("http://localhost:9411/v0/webcapture?editgroup_id={}", editgroup_id),
+ &format!(
+ "http://localhost:9411/v0/webcapture?editgroup_id={}",
+ editgroup_id
+ ),
headers.clone(),
r#"{"original_url": "https://bnewbold.net/",
"timestamp": "2018-12-28T05:06:07Z",
@@ -726,7 +738,10 @@ fn test_post_release() {
helpers::check_http_response(
request::post(
- &format!("http://localhost:9411/v0/release?editgroup_id={}", editgroup_id),
+ &format!(
+ "http://localhost:9411/v0/release?editgroup_id={}",
+ editgroup_id
+ ),
headers.clone(),
// TODO: target_release_id
r#"{"title": "secret minimal paper",
@@ -742,7 +757,10 @@ fn test_post_release() {
// No work_id supplied (auto-created)
helpers::check_http_response(
request::post(
- &format!("http://localhost:9411/v0/release?editgroup_id={}", editgroup_id),
+ &format!(
+ "http://localhost:9411/v0/release?editgroup_id={}",
+ editgroup_id
+ ),
headers.clone(),
// TODO: target_release_id
r#"{"title": "secret minimal paper the second",
@@ -756,7 +774,10 @@ fn test_post_release() {
helpers::check_http_response(
request::post(
- &format!("http://localhost:9411/v0/release?editgroup_id={}", editgroup_id),
+ &format!(
+ "http://localhost:9411/v0/release?editgroup_id={}",
+ editgroup_id
+ ),
headers.clone(),
// TODO: target_release_id
r#"{"title": "secret paper",
@@ -918,7 +939,10 @@ fn test_accept_editgroup() {
helpers::check_http_response(
request::post(
- &format!("http://localhost:9411/v0/container?editgroup_id={}", uuid2fcid(&editgroup_id)),
+ &format!(
+ "http://localhost:9411/v0/container?editgroup_id={}",
+ uuid2fcid(&editgroup_id)
+ ),
headers.clone(),
&format!(
"{{\"name\": \"test journal 1\", \"editgroup_id\": \"{}\"}}",
@@ -931,7 +955,10 @@ fn test_accept_editgroup() {
);
helpers::check_http_response(
request::post(
- &format!("http://localhost:9411/v0/container?editgroup_id={}", uuid2fcid(&editgroup_id)),
+ &format!(
+ "http://localhost:9411/v0/container?editgroup_id={}",
+ uuid2fcid(&editgroup_id)
+ ),
headers.clone(),
&format!(
"{{\"name\": \"test journal 2\", \"editgroup_id\": \"{}\"}}",
@@ -1200,7 +1227,10 @@ fn test_abstracts() {
helpers::check_http_response(
request::post(
- &format!("http://localhost:9411/v0/release?editgroup_id={}", editgroup_id),
+ &format!(
+ "http://localhost:9411/v0/release?editgroup_id={}",
+ editgroup_id
+ ),
headers.clone(),
r#"{"title": "some paper",
"doi": "10.1234/iiiiiii",
@@ -1222,7 +1252,10 @@ fn test_abstracts() {
// Same abstracts; checking that re-inserting works
helpers::check_http_response(
request::post(
- &format!("http://localhost:9411/v0/release?editgroup_id={}", editgroup_id),
+ &format!(
+ "http://localhost:9411/v0/release?editgroup_id={}",
+ editgroup_id
+ ),
headers.clone(),
r#"{"title": "some paper again",
"abstracts": [
@@ -1292,7 +1325,10 @@ fn test_contribs() {
helpers::check_http_response(
request::post(
- &format!("http://localhost:9411/v0/release?editgroup_id={}", editgroup_id),
+ &format!(
+ "http://localhost:9411/v0/release?editgroup_id={}",
+ editgroup_id
+ ),
headers.clone(),
r#"{"title": "some paper",
"doi": "10.1234/iiiiiii",