mirror of
https://github.com/agersant/polaris
synced 2024-12-04 02:29:11 +00:00
Added unit test for api/flatten
This commit is contained in:
parent
79992b7120
commit
43538853a4
1 changed files with 21 additions and 1 deletions
|
@ -379,7 +379,27 @@ fn browse() {
|
|||
|
||||
#[test]
|
||||
fn flatten() {
|
||||
// TODO
|
||||
let env = get_test_environment("api_flatten.sqlite");
|
||||
let client = &env.client;
|
||||
complete_initial_setup(client);
|
||||
do_auth(client);
|
||||
env.update_index();
|
||||
|
||||
{
|
||||
let mut response = client.get("/api/flatten").dispatch();
|
||||
assert_eq!(response.status(), Status::Ok);
|
||||
let response_body = response.body_string().unwrap();
|
||||
let response_json: Vec<index::Song> = serde_json::from_str(&response_body).unwrap();
|
||||
assert_eq!(response_json.len(), 12);
|
||||
}
|
||||
|
||||
{
|
||||
let mut response = client.get("/api/flatten/collection").dispatch();
|
||||
assert_eq!(response.status(), Status::Ok);
|
||||
let response_body = response.body_string().unwrap();
|
||||
let response_json: Vec<index::Song> = serde_json::from_str(&response_body).unwrap();
|
||||
assert_eq!(response_json.len(), 12);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Reference in a new issue