Added unit test for getting recent albums

This commit is contained in:
Antoine Gersant 2017-05-08 20:41:45 -07:00
parent 72213fbb8c
commit 29d048b375

View file

@ -776,3 +776,12 @@ fn test_random() {
let results = index.get_random_albums(1).unwrap();
assert_eq!(results.len(), 1);
}
#[test]
fn test_recent() {
let index = _get_test_index("recent.sqlite");
index.update_index().unwrap();
let results = index.get_recent_albums(2).unwrap();
assert_eq!(results.len(), 2);
assert_eq!(results[0].artist, Some("Khemmis".to_owned()));
}