diff --git a/plume-models/src/comments.rs b/plume-models/src/comments.rs index 2ae71d93..dd7c779b 100644 --- a/plume-models/src/comments.rs +++ b/plume-models/src/comments.rs @@ -463,13 +463,13 @@ mod tests { assert_json_eq!(to_value(&act).unwrap(), json!({ "actor": "https://plu.me/@/admin/", "cc": ["https://plu.me/@/admin/followers"], - "id": format!("https://plu.me/~/BlogName/testing/comment/{}/activity", original_comm.id), + "id": format!("https://plu.me/~/Blog%20Name/testing/comment/{}/activity", original_comm.id), "object": { "attributedTo": "https://plu.me/@/admin/", "content": r###"

My comment, mentioning to @user

"###, - "id": format!("https://plu.me/~/BlogName/testing/comment/{}", original_comm.id), - "inReplyTo": "https://plu.me/~/BlogName/testing", + "id": format!("https://plu.me/~/Blog%20Name/testing/comment/{}", original_comm.id), + "inReplyTo": "https://plu.me/~/Blog%20Name/testing", "published": format_datetime(&original_comm.creation_date), "summary": "My CW", "tag": [ @@ -505,12 +505,12 @@ mod tests { assert_json_eq!(to_value(&reply_act).unwrap(), json!({ "actor": "https://plu.me/@/user/", "cc": ["https://plu.me/@/user/followers"], - "id": format!("https://plu.me/~/BlogName/testing/comment/{}/activity", reply.id), + "id": format!("https://plu.me/~/Blog%20Name/testing/comment/{}/activity", reply.id), "object": { "attributedTo": "https://plu.me/@/user/", "content": "", - "id": format!("https://plu.me/~/BlogName/testing/comment/{}", reply.id), - "inReplyTo": format!("https://plu.me/~/BlogName/testing/comment/{}", original_comm.id), + "id": format!("https://plu.me/~/Blog%20Name/testing/comment/{}", reply.id), + "inReplyTo": format!("https://plu.me/~/Blog%20Name/testing/comment/{}", original_comm.id), "published": format_datetime(&reply.creation_date), "summary": "", "tag": [], @@ -554,8 +554,8 @@ mod tests { "attributedTo": "https://plu.me/@/admin/", "content": r###"

My comment, mentioning to @user

"###, - "id": format!("https://plu.me/~/BlogName/testing/comment/{}", comment.id), - "inReplyTo": "https://plu.me/~/BlogName/testing", + "id": format!("https://plu.me/~/Blog%20Name/testing/comment/{}", comment.id), + "inReplyTo": "https://plu.me/~/Blog%20Name/testing", "published": format_datetime(&comment.creation_date), "summary": "My CW", "tag": [ @@ -584,9 +584,9 @@ mod tests { let expected = json!({ "actor": "https://plu.me/@/admin/", - "id": format!("https://plu.me/~/BlogName/testing/comment/{}#delete", comment.id), + "id": format!("https://plu.me/~/Blog%20Name/testing/comment/{}#delete", comment.id), "object": { - "id": format!("https://plu.me/~/BlogName/testing/comment/{}", comment.id), + "id": format!("https://plu.me/~/Blog%20Name/testing/comment/{}", comment.id), "type": "Tombstone" }, "to": ["https://www.w3.org/ns/activitystreams#Public"], diff --git a/plume-models/src/inbox.rs b/plume-models/src/inbox.rs index aafc8b32..5f922e13 100644 --- a/plume-models/src/inbox.rs +++ b/plume-models/src/inbox.rs @@ -268,7 +268,7 @@ pub(crate) mod tests { "actor": users[0].ap_url, "object": { "type": "Article", - "id": "https://plu.me/~/BlogName/testing", + "id": "https://plu.me/~/Blog%20Name/testing", "attributedTo": [users[0].ap_url, blogs[0].ap_url], "content": "Hello.", "name": "My Article", diff --git a/plume-models/src/likes.rs b/plume-models/src/likes.rs index 5cf0b29d..4b3a78b0 100644 --- a/plume-models/src/likes.rs +++ b/plume-models/src/likes.rs @@ -205,8 +205,8 @@ mod tests { let expected = json!({ "actor": "https://plu.me/@/admin/", "cc": ["https://plu.me/@/admin/followers"], - "id": "https://plu.me/@/admin/like/https://plu.me/~/BlogName/testing", - "object": "https://plu.me/~/BlogName/testing", + "id": "https://plu.me/@/admin/like/https://plu.me/~/Blog%20Name/testing", + "object": "https://plu.me/~/Blog%20Name/testing", "to": ["https://www.w3.org/ns/activitystreams#Public"], "type": "Like", }); @@ -229,12 +229,12 @@ mod tests { let expected = json!({ "actor": "https://plu.me/@/admin/", "cc": ["https://plu.me/@/admin/followers"], - "id": "https://plu.me/@/admin/like/https://plu.me/~/BlogName/testing#delete", + "id": "https://plu.me/@/admin/like/https://plu.me/~/Blog%20Name/testing#delete", "object": { "actor": "https://plu.me/@/admin/", "cc": ["https://plu.me/@/admin/followers"], - "id": "https://plu.me/@/admin/like/https://plu.me/~/BlogName/testing", - "object": "https://plu.me/~/BlogName/testing", + "id": "https://plu.me/@/admin/like/https://plu.me/~/Blog%20Name/testing", + "object": "https://plu.me/~/Blog%20Name/testing", "to": ["https://www.w3.org/ns/activitystreams#Public"], "type": "Like", }, diff --git a/plume-models/src/posts.rs b/plume-models/src/posts.rs index 203e0d5e..cc5f7fb1 100644 --- a/plume-models/src/posts.rs +++ b/plume-models/src/posts.rs @@ -1109,10 +1109,10 @@ mod tests { let act = post.to_activity(&conn)?; let expected = json!({ - "attributedTo": ["https://plu.me/@/admin/", "https://plu.me/~/BlogName/"], + "attributedTo": ["https://plu.me/@/admin/", "https://plu.me/~/Blog%20Name/"], "cc": [], "content": "Hello", - "id": "https://plu.me/~/BlogName/testing", + "id": "https://plu.me/~/Blog%20Name/testing", "license": "WTFPL", "name": "Testing", "published": format_datetime(&post.creation_date), @@ -1130,7 +1130,7 @@ mod tests { ], "to": ["https://www.w3.org/ns/activitystreams#Public"], "type": "Article", - "url": "https://plu.me/~/BlogName/testing" + "url": "https://plu.me/~/Blog%20Name/testing" }); assert_json_eq!(to_value(act)?, expected); @@ -1149,12 +1149,12 @@ mod tests { let expected = json!({ "actor": "https://plu.me/@/admin/", "cc": [], - "id": "https://plu.me/~/BlogName/testing/activity", + "id": "https://plu.me/~/Blog%20Name/testing/activity", "object": { - "attributedTo": ["https://plu.me/@/admin/", "https://plu.me/~/BlogName/"], + "attributedTo": ["https://plu.me/@/admin/", "https://plu.me/~/Blog%20Name/"], "cc": [], "content": "Hello", - "id": "https://plu.me/~/BlogName/testing", + "id": "https://plu.me/~/Blog%20Name/testing", "license": "WTFPL", "name": "Testing", "published": format_datetime(&post.creation_date), @@ -1172,7 +1172,7 @@ mod tests { ], "to": ["https://www.w3.org/ns/activitystreams#Public"], "type": "Article", - "url": "https://plu.me/~/BlogName/testing" + "url": "https://plu.me/~/Blog%20Name/testing" }, "to": ["https://www.w3.org/ns/activitystreams#Public"], "type": "Create" @@ -1194,12 +1194,12 @@ mod tests { let expected = json!({ "actor": "https://plu.me/@/admin/", "cc": [], - "id": "https://plu.me/~/BlogName/testing/update-", + "id": "https://plu.me/~/Blog%20Name/testing/update-", "object": { - "attributedTo": ["https://plu.me/@/admin/", "https://plu.me/~/BlogName/"], + "attributedTo": ["https://plu.me/@/admin/", "https://plu.me/~/Blog%20Name/"], "cc": [], "content": "Hello", - "id": "https://plu.me/~/BlogName/testing", + "id": "https://plu.me/~/Blog%20Name/testing", "license": "WTFPL", "name": "Testing", "published": format_datetime(&post.creation_date), @@ -1217,7 +1217,7 @@ mod tests { ], "to": ["https://www.w3.org/ns/activitystreams#Public"], "type": "Article", - "url": "https://plu.me/~/BlogName/testing" + "url": "https://plu.me/~/Blog%20Name/testing" }, "to": ["https://www.w3.org/ns/activitystreams#Public"], "type": "Update" @@ -1226,10 +1226,10 @@ mod tests { let id = actual["id"].to_string(); let (id_pre, id_post) = id.rsplit_once('-').unwrap(); - assert_eq!(post.ap_url, "https://plu.me/~/BlogName/testing"); + assert_eq!(post.ap_url, "https://plu.me/~/Blog%20Name/testing"); assert_eq!( id_pre, - to_value("\"https://plu.me/~/BlogName/testing/update") + to_value("\"https://plu.me/~/Blog%20Name/testing/update") .unwrap() .as_str() .unwrap() @@ -1259,9 +1259,9 @@ mod tests { let expected = json!({ "actor": "https://plu.me/@/admin/", - "id": "https://plu.me/~/BlogName/testing#delete", + "id": "https://plu.me/~/Blog%20Name/testing#delete", "object": { - "id": "https://plu.me/~/BlogName/testing", + "id": "https://plu.me/~/Blog%20Name/testing", "type": "Tombstone" }, "to": [ diff --git a/plume-models/src/reshares.rs b/plume-models/src/reshares.rs index 67811da1..495039ea 100644 --- a/plume-models/src/reshares.rs +++ b/plume-models/src/reshares.rs @@ -235,8 +235,8 @@ mod test { let expected = json!({ "actor": "https://plu.me/@/admin/", "cc": ["https://plu.me/@/admin/followers"], - "id": "https://plu.me/@/admin/reshare/https://plu.me/~/BlogName/testing", - "object": "https://plu.me/~/BlogName/testing", + "id": "https://plu.me/@/admin/reshare/https://plu.me/~/Blog%20Name/testing", + "object": "https://plu.me/~/Blog%20Name/testing", "to": ["https://www.w3.org/ns/activitystreams#Public"], "type": "Announce", }); @@ -259,12 +259,12 @@ mod test { let expected = json!({ "actor": "https://plu.me/@/admin/", "cc": ["https://plu.me/@/admin/followers"], - "id": "https://plu.me/@/admin/reshare/https://plu.me/~/BlogName/testing#delete", + "id": "https://plu.me/@/admin/reshare/https://plu.me/~/Blog%20Name/testing#delete", "object": { "actor": "https://plu.me/@/admin/", "cc": ["https://plu.me/@/admin/followers"], - "id": "https://plu.me/@/admin/reshare/https://plu.me/~/BlogName/testing", - "object": "https://plu.me/~/BlogName/testing", + "id": "https://plu.me/@/admin/reshare/https://plu.me/~/Blog%20Name/testing", + "object": "https://plu.me/~/Blog%20Name/testing", "to": ["https://www.w3.org/ns/activitystreams#Public"], "type": "Announce" },