Trim spaces from new tags #28
@@ -424,7 +424,8 @@ mod tests {
|
|||||||
assert_eq!(status, 200);
|
assert_eq!(status, 200);
|
||||||
|
|
||||||
let body: PhotosResponse = serde_json::from_str(&response.read_to_str()).unwrap();
|
let body: PhotosResponse = serde_json::from_str(&response.read_to_str()).unwrap();
|
||||||
|
debug!("{:?}", body);
|
||||||
|
|
||||||
assert!(body.photos.contains(&String::from("photo.jpg")));
|
assert!(body.photos.contains(&String::from("photo.jpg")));
|
||||||
assert!(body.dirs.contains(&String::from("test-dir")));
|
assert!(body.dirs.contains(&String::from("test-dir")));
|
||||||
assert!(body
|
assert!(body
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ async fn add_tag<D: TagDao>(
|
|||||||
if let Some((_, tag)) = tags.iter().find(|t| t.1.name == tag_name) {
|
if let Some((_, tag)) = tags.iter().find(|t| t.1.name == tag_name) {
|
||||||
Ok(tag.clone())
|
Ok(tag.clone())
|
||||||
} else {
|
} else {
|
||||||
tag_dao.create_tag(&tag_name)
|
tag_dao.create_tag(tag_name.trim())
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.and_then(|tag| tag_dao.tag_file(&body.file_name, tag.id))
|
.and_then(|tag| tag_dao.tag_file(&body.file_name, tag.id))
|
||||||
@@ -491,6 +491,10 @@ mod tests {
|
|||||||
) -> anyhow::Result<Vec<String>> {
|
) -> anyhow::Result<Vec<String>> {
|
||||||
todo!()
|
todo!()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn get_files_with_any_tag_ids(&mut self, tag_ids: Vec<i32>) -> anyhow::Result<Vec<String>> {
|
||||||
|
todo!()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
|
|||||||
Reference in New Issue
Block a user