Update tests
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
parent
6ffa90a42a
commit
97b94a2f43
3 changed files with 35 additions and 9 deletions
|
|
@ -220,5 +220,13 @@ defmodule Pleroma.Web.ActivityPub.UserViewTest do
|
|||
"acceptsChatMessages"
|
||||
)
|
||||
end
|
||||
|
||||
test "it returns false if chat is disabled" do
|
||||
clear_config([Pleroma.Chat, :enabled], false)
|
||||
user = insert(:user, accepts_chat_messages: true)
|
||||
|
||||
assert %{"capabilities" => %{"acceptsChatMessages" => false}} =
|
||||
UserView.render("user.json", user: user)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -546,6 +546,14 @@ defmodule Pleroma.Web.PleromaAPI.ChatControllerTest do
|
|||
account_ids = Enum.map(result, &get_in(&1, ["account", "id"]))
|
||||
assert Enum.sort(account_ids) == Enum.sort([user2.id, user3.id])
|
||||
end
|
||||
|
||||
test "it returns 404 when chats are disabled", %{conn: conn} do
|
||||
clear_config([Pleroma.Chat, :enabled], false)
|
||||
|
||||
conn
|
||||
|> get(unquote(tested_endpoint))
|
||||
|> json_response_and_validate_schema(404)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue