summaryrefslogtreecommitdiffstats
path: root/rust/tests/test_api_server.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-06-28 12:24:06 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-06-28 12:24:08 -0700
commit3a49586df2545723a6cc6280cd8c9b75a535042f (patch)
tree34ac04264fd750d6f4168af051cedb08ae470203 /rust/tests/test_api_server.rs
parentf30e45c3eae4371cc5f1bee030791187a173c284 (diff)
downloadfatcat-3a49586df2545723a6cc6280cd8c9b75a535042f.tar.gz
fatcat-3a49586df2545723a6cc6280cd8c9b75a535042f.zip
auto-create works for releases
If a work_id isn't supplied, create a new work and link it. Note that the work_id doesn't get passed back in the response, only the release_id.
Diffstat (limited to 'rust/tests/test_api_server.rs')
-rw-r--r--rust/tests/test_api_server.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/rust/tests/test_api_server.rs b/rust/tests/test_api_server.rs
index 7d63afe9..3db01f65 100644
--- a/rust/tests/test_api_server.rs
+++ b/rust/tests/test_api_server.rs
@@ -286,6 +286,21 @@ fn test_post_release() {
None,
); // TODO: "secret paper"
+ // No work_id supplied (auto-created)
+ check_response(
+ request::post(
+ "http://localhost:9411/v0/release",
+ headers.clone(),
+ // TODO: target_release_id
+ r#"{"title": "secret minimal paper the second",
+ "release_type": "journal-article"
+ }"#,
+ &router,
+ ),
+ status::Created,
+ None,
+ );
+
check_response(
request::post(
"http://localhost:9411/v0/release",