Added API test for search without query

This commit is contained in:
Antoine Gersant 2020-09-24 00:07:55 -07:00
parent ca8f046142
commit cf67e44d20

View file

@ -348,6 +348,16 @@ fn test_service_recent() {
assert_eq!(entries.len(), 3);
}
#[test]
fn test_service_search_root() {
let mut service = ServiceType::new(&format!("{}{}", TEST_DB_PREFIX, line!()));
service.complete_initial_setup();
service.login();
service.index();
let response = service.get_json::<Vec<index::CollectionFile>>("/api/search");
assert_eq!(response.status(), StatusCode::OK);
}
#[test]
fn test_service_search() {
let mut service = ServiceType::new(&format!("{}{}", TEST_DB_PREFIX, line!()));
@ -363,7 +373,6 @@ fn test_service_search() {
_ => panic!(),
}
}
#[test]
fn test_service_serve() {
let mut service = ServiceType::new(&format!("{}{}", TEST_DB_PREFIX, line!()));