From 5bea71dbb4d4323a93b35b5ab7555190dd9bbfbb Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Sun, 17 Jun 2018 17:01:39 -0700 Subject: implement reverse lookups --- rust/tests/test_api_server.rs | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'rust/tests') 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 @@ -146,6 +146,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(); -- cgit v1.2.3