Verified Commit 51d5951c authored by minibikini's avatar minibikini
Browse files

Test that only author can reblog a private status

parent 1b79dce7
Pipeline #34184 passed with stages
in 5 minutes and 38 seconds
......@@ -745,14 +745,19 @@ test "repeating a status privately" do
end
test "author can repeat own private statuses" do
user = insert(:user)
author = insert(:user)
follower = insert(:user)
CommonAPI.follow(follower, author)
{:ok, activity} = CommonAPI.post(user, %{status: "cofe", visibility: "private"})
{:ok, activity} = CommonAPI.post(author, %{status: "cofe", visibility: "private"})
{:ok, %Activity{} = announce_activity} = CommonAPI.repeat(activity.id, user)
{:ok, %Activity{} = announce_activity} = CommonAPI.repeat(activity.id, author)
assert Visibility.is_private?(announce_activity)
refute Visibility.visible_for_user?(announce_activity, nil)
assert Visibility.visible_for_user?(activity, follower)
assert {:error, :not_found} = CommonAPI.repeat(activity.id, follower)
end
test "favoriting a status" do
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment