mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-12-22 17:27:18 +00:00
Test that only author can reblog a private status
This commit is contained in:
parent
1b79dce7bc
commit
51d5951c02
|
@ -745,14 +745,19 @@ defmodule Pleroma.Web.CommonAPITest do
|
||||||
end
|
end
|
||||||
|
|
||||||
test "author can repeat own private statuses" do
|
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)
|
assert Visibility.is_private?(announce_activity)
|
||||||
refute Visibility.visible_for_user?(announce_activity, nil)
|
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
|
end
|
||||||
|
|
||||||
test "favoriting a status" do
|
test "favoriting a status" do
|
||||||
|
|
Loading…
Reference in a new issue