From 84a3d5307506871a0ce14639e1ed0f96ad013fbe Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Sun, 24 Jan 2021 23:00:53 +0900 Subject: [PATCH] Use uri! macro to generate URI strings --- src/routes/blogs.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/routes/blogs.rs b/src/routes/blogs.rs index bc0ffbfc..31c5c6ea 100644 --- a/src/routes/blogs.rs +++ b/src/routes/blogs.rs @@ -401,8 +401,12 @@ mod tests { let (_instance, user, blog, post) = create_models(conn); - let blog_path = format!("/~/{}", blog.fqn); - let edit_link = format!(r#"href="{}/{}/edit""#, blog_path, post.slug); + let blog_path = uri!(super::activity_details: name = &blog.fqn).to_string(); + let edit_link = uri!( + super::super::posts::edit: blog = &blog.fqn, + slug = &post.slug + ) + .to_string(); let mut response = client.get(&blog_path).dispatch(); let body = response.body_string().unwrap();