mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-11-22 03:21:01 +00:00
Add test for blog slug validation
This commit is contained in:
parent
2dd33769d4
commit
65829094c9
1 changed files with 7 additions and 0 deletions
|
@ -379,6 +379,7 @@ pub fn atom_feed(name: String, conn: DbConn) -> Option<Content<String>> {
|
|||
|
||||
#[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());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue