-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated thread implementation to work with posts instead of activities
refs [AP-721](https://linear.app/ghost/issue/AP-721/update-getactivitythread-to-work-with-posts-instead-of-activities) Updated thread implementation to work with posts instead of activities as part of the posts migration
- Loading branch information
Showing
10 changed files
with
614 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
@only | ||
Feature: Thread | ||
In order to see replies to a post | ||
As a user | ||
I want to request the thread for a post | ||
|
||
Background: | ||
Given an Actor "Person(Alice)" | ||
And a "Follow(Us)" Activity "Follow" by "Alice" | ||
And "Alice" sends "Follow" to the Inbox | ||
And "Follow" is in our Inbox | ||
And we follow "Alice" | ||
And the request is accepted | ||
And a "Accept(Follow(Alice))" Activity "Accept" by "Alice" | ||
And "Alice" sends "Accept" to the Inbox | ||
And "Accept" is in our Inbox | ||
And a "Note" Object "Article" by "Alice" | ||
And a "Create(Article)" Activity "Create" by "Alice" | ||
And "Alice" sends "Create" to the Inbox | ||
And "Create" is in our Inbox | ||
|
||
Scenario: Retrieving the thread for a top level post | ||
Given we reply "Reply1" to "Article" with the content | ||
""" | ||
This is a great article! | ||
""" | ||
And "Reply1" is in our Outbox | ||
And we reply "Reply2" to "Article" with the content | ||
""" | ||
This is still a great article! | ||
""" | ||
And "Reply2" is in our Outbox | ||
And we reply "Reply3" to "Reply1" with the content | ||
""" | ||
This is a great reply! | ||
""" | ||
And "Reply3" is in our Outbox | ||
When an authenticated request is made to "/.ghost/activitypub/thread/Article" | ||
Then the request is accepted | ||
And the thread contains "3" posts | ||
And post "1" in the thread is "Article" | ||
And post "2" in the thread is "Reply1" | ||
And post "3" in the thread is "Reply2" | ||
|
||
Scenario: Retrieving the thread for a reply to a post | ||
Given we reply "Reply1" to "Article" with the content | ||
""" | ||
This is a great article! | ||
""" | ||
And "Reply1" is in our Outbox | ||
And we reply "Reply2" to "Article" with the content | ||
""" | ||
This is still a great article! | ||
""" | ||
And "Reply2" is in our Outbox | ||
And we reply "Reply3" to "Reply1" with the content | ||
""" | ||
This is a great reply! | ||
""" | ||
And "Reply3" is in our Outbox | ||
When an authenticated request is made to "/.ghost/activitypub/thread/Reply3" | ||
Then the request is accepted | ||
And the thread contains "3" posts | ||
And post "1" in the thread is "Article" | ||
And post "2" in the thread is "Reply1" | ||
And post "3" in the thread is "Reply3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{ | ||
"posts": [ | ||
{ | ||
"attachments": [], | ||
"author": { | ||
"avatarUrl": "https://example.com/avatars/foobar.png", | ||
"handle": "foobar", | ||
"id": "https://example.com/users/456", | ||
"name": "Foo Bar", | ||
"url": "https://example.com/users/456", | ||
}, | ||
"content": "Test Content 1", | ||
"excerpt": "Test Excerpt 1", | ||
"featureImageUrl": "https://example.com/feature-images/post-1.jpg", | ||
"id": "https://example.com/.ghost/activitypub/article/aaa-bbb-ccc", | ||
"likeCount": 0, | ||
"likedByMe": false, | ||
"publishedAt": "2025-02-27T15:40:00.000Z", | ||
"readingTimeMinutes": 1, | ||
"replyCount": 0, | ||
"repostCount": 0, | ||
"repostedBy": null, | ||
"repostedByMe": false, | ||
"title": "Test Post 1", | ||
"type": 1, | ||
"url": "https://example.com/posts/1", | ||
}, | ||
{ | ||
"attachments": [], | ||
"author": { | ||
"avatarUrl": "https://example.com/avatars/foobar.png", | ||
"handle": "foobar", | ||
"id": "https://example.com/users/456", | ||
"name": "Foo Bar", | ||
"url": "https://example.com/users/456", | ||
}, | ||
"content": "Test Content 2", | ||
"excerpt": "Test Excerpt 2", | ||
"featureImageUrl": "https://example.com/feature-images/post-2.jpg", | ||
"id": "https://example.com/.ghost/activitypub/article/ddd-eee-fff", | ||
"likeCount": 0, | ||
"likedByMe": true, | ||
"publishedAt": "2025-02-27T15:40:00.000Z", | ||
"readingTimeMinutes": 1, | ||
"replyCount": 0, | ||
"repostCount": 0, | ||
"repostedBy": null, | ||
"repostedByMe": false, | ||
"title": "Test Post 2", | ||
"type": 1, | ||
"url": "https://example.com/posts/2", | ||
}, | ||
{ | ||
"attachments": [], | ||
"author": { | ||
"avatarUrl": "https://example.com/avatars/foobar.png", | ||
"handle": "foobar", | ||
"id": "https://example.com/users/456", | ||
"name": "Foo Bar", | ||
"url": "https://example.com/users/456", | ||
}, | ||
"content": "Test Content 3", | ||
"excerpt": "Test Excerpt 3", | ||
"featureImageUrl": "https://example.com/feature-images/post-3.jpg", | ||
"id": "https://example.com/.ghost/activitypub/article/ggg-hhh-iii", | ||
"likeCount": 0, | ||
"likedByMe": false, | ||
"publishedAt": "2025-02-27T15:40:00.000Z", | ||
"readingTimeMinutes": 1, | ||
"replyCount": 0, | ||
"repostCount": 0, | ||
"repostedBy": null, | ||
"repostedByMe": true, | ||
"title": "Test Post 3", | ||
"type": 1, | ||
"url": "https://example.com/posts/3", | ||
}, | ||
], | ||
} |
Oops, something went wrong.