aboutsummaryrefslogtreecommitdiffstats
path: root/rust/tests
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-06-17 17:01:39 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-06-17 17:01:39 -0700
commit5bea71dbb4d4323a93b35b5ab7555190dd9bbfbb (patch)
tree9a8f4921eb092df1bae2b8e69c92956235a365bc /rust/tests
parentc1613504dbe96951ae59889fc11b0564cfbbcd83 (diff)
downloadfatcat-5bea71dbb4d4323a93b35b5ab7555190dd9bbfbb.tar.gz
fatcat-5bea71dbb4d4323a93b35b5ab7555190dd9bbfbb.zip
implement reverse lookups
Diffstat (limited to 'rust/tests')
-rw-r--r--rust/tests/test_api_server.rs35
1 files changed, 35 insertions, 0 deletions
diff --git a/rust/tests/test_api_server.rs b/rust/tests/test_api_server.rs
index 32db268c..05dd493f 100644
--- a/rust/tests/test_api_server.rs
+++ b/rust/tests/test_api_server.rs
@@ -147,6 +147,41 @@ fn test_lookups() {
}
#[test]
+fn test_reverse_lookups() {
+ let (headers, router, _conn) = setup();
+
+ check_response(
+ request::get(
+ "http://localhost:9411/v0/creator/00000000-0000-0000-2222-000000000002/releases",
+ headers.clone(),
+ &router,
+ ),
+ status::Ok,
+ Some("bigger example"),
+ );
+
+ check_response(
+ request::get(
+ "http://localhost:9411/v0/release/00000000-0000-0000-4444-000000000002/files",
+ headers.clone(),
+ &router,
+ ),
+ status::Ok,
+ Some("7d97e98f8af710c7e7fe703abc8f639e0ee507c4"),
+ );
+
+ check_response(
+ request::get(
+ "http://localhost:9411/v0/work/00000000-0000-0000-5555-000000000002/releases",
+ headers.clone(),
+ &router,
+ ),
+ status::Ok,
+ Some("bigger example"),
+ );
+}
+
+#[test]
fn test_post_container() {
let (headers, router, _conn) = setup();