Merge remote-tracking branch 'upstream/develop' into aliases
This commit is contained in:
commit
1a5a7ba6e8
186 changed files with 4752 additions and 940 deletions
|
|
@ -332,5 +332,27 @@ defmodule Pleroma.Web.PleromaAPI.ChatControllerTest do
|
|||
chat_1.id |> to_string()
|
||||
]
|
||||
end
|
||||
|
||||
test "it is not affected by :restrict_unauthenticated setting (issue #1973)", %{
|
||||
conn: conn,
|
||||
user: user
|
||||
} do
|
||||
clear_config([:restrict_unauthenticated, :profiles, :local], true)
|
||||
clear_config([:restrict_unauthenticated, :profiles, :remote], true)
|
||||
|
||||
user2 = insert(:user)
|
||||
user3 = insert(:user, local: false)
|
||||
|
||||
{:ok, _chat_12} = Chat.get_or_create(user.id, user2.ap_id)
|
||||
{:ok, _chat_13} = Chat.get_or_create(user.id, user3.ap_id)
|
||||
|
||||
result =
|
||||
conn
|
||||
|> get("/api/v1/pleroma/chats")
|
||||
|> json_response_and_validate_schema(200)
|
||||
|
||||
account_ids = Enum.map(result, &get_in(&1, ["account", "id"]))
|
||||
assert Enum.sort(account_ids) == Enum.sort([user2.id, user3.id])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ defmodule Pleroma.Web.PleromaAPI.EmojiPackControllerTest do
|
|||
)
|
||||
setup do: clear_config([:auth, :enforce_oauth_admin_scope_usage], false)
|
||||
|
||||
setup do: clear_config([:instance, :public], true)
|
||||
|
||||
setup do
|
||||
admin = insert(:user, is_admin: true)
|
||||
token = insert(:oauth_admin_token, user: admin)
|
||||
|
|
@ -27,6 +29,11 @@ defmodule Pleroma.Web.PleromaAPI.EmojiPackControllerTest do
|
|||
{:ok, %{admin_conn: admin_conn}}
|
||||
end
|
||||
|
||||
test "GET /api/pleroma/emoji/packs when :public: false", %{conn: conn} do
|
||||
Config.put([:instance, :public], false)
|
||||
conn |> get("/api/pleroma/emoji/packs") |> json_response_and_validate_schema(200)
|
||||
end
|
||||
|
||||
test "GET /api/pleroma/emoji/packs", %{conn: conn} do
|
||||
resp = conn |> get("/api/pleroma/emoji/packs") |> json_response_and_validate_schema(200)
|
||||
|
||||
|
|
|
|||
|
|
@ -106,6 +106,23 @@ defmodule Pleroma.Web.PleromaAPI.EmojiReactionControllerTest do
|
|||
result
|
||||
end
|
||||
|
||||
test "GET /api/v1/pleroma/statuses/:id/reactions with :show_reactions disabled", %{conn: conn} do
|
||||
clear_config([:instance, :show_reactions], false)
|
||||
|
||||
user = insert(:user)
|
||||
other_user = insert(:user)
|
||||
|
||||
{:ok, activity} = CommonAPI.post(user, %{status: "#cofe"})
|
||||
{:ok, _} = CommonAPI.react_with_emoji(activity.id, other_user, "🎅")
|
||||
|
||||
result =
|
||||
conn
|
||||
|> get("/api/v1/pleroma/statuses/#{activity.id}/reactions")
|
||||
|> json_response_and_validate_schema(200)
|
||||
|
||||
assert result == []
|
||||
end
|
||||
|
||||
test "GET /api/v1/pleroma/statuses/:id/reactions/:emoji", %{conn: conn} do
|
||||
user = insert(:user)
|
||||
other_user = insert(:user)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue