From 65829094c94f4097c0b6d6d275e8f252f7b118c2 Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Fri, 20 May 2022 01:40:51 +0900 Subject: [PATCH] Add test for blog slug validation --- src/routes/blogs.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/routes/blogs.rs b/src/routes/blogs.rs index 7359779a..99c63bf3 100644 --- a/src/routes/blogs.rs +++ b/src/routes/blogs.rs @@ -379,6 +379,7 @@ pub fn atom_feed(name: String, conn: DbConn) -> Option> { #[cfg(test)] mod tests { + use super::valid_slug; use crate::init_rocket; use diesel::Connection; use plume_common::utils::random_hex; @@ -524,4 +525,10 @@ mod tests { .finish(), ); } + + #[test] + fn test_valid_slug() { + assert!(valid_slug("Blog Title").is_ok()); + assert!(valid_slug("ブログ タイトル").is_ok()); + } }