Add test for blog slug validation

This commit is contained in:
Kitaiti Makoto 2022-05-20 01:40:51 +09:00
parent 2dd33769d4
commit 65829094c9

View File

@ -379,6 +379,7 @@ pub fn atom_feed(name: String, conn: DbConn) -> Option<Content<String>> {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::valid_slug;
use crate::init_rocket; use crate::init_rocket;
use diesel::Connection; use diesel::Connection;
use plume_common::utils::random_hex; use plume_common::utils::random_hex;
@ -524,4 +525,10 @@ mod tests {
.finish(), .finish(),
); );
} }
#[test]
fn test_valid_slug() {
assert!(valid_slug("Blog Title").is_ok());
assert!(valid_slug("ブログ タイトル").is_ok());
}
} }