|
|
@ -65,12 +65,11 @@ defmodule Pleroma.Web.MastodonAPI.ConversationControllerTest do
|
|
|
|
assert Participation.unread_count(user_one) == 0
|
|
|
|
assert Participation.unread_count(user_one) == 0
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
test "special behaviour when conversation have only one user", %{
|
|
|
|
test "includes the user if the user is the only participant", %{
|
|
|
|
user: user_one,
|
|
|
|
user: user_one,
|
|
|
|
user_two: user_two,
|
|
|
|
|
|
|
|
conn: conn
|
|
|
|
conn: conn
|
|
|
|
} do
|
|
|
|
} do
|
|
|
|
{:ok, direct} = create_direct_message(user_one, [])
|
|
|
|
{:ok, _direct} = create_direct_message(user_one, [])
|
|
|
|
|
|
|
|
|
|
|
|
res_conn = get(conn, "/api/v1/conversations")
|
|
|
|
res_conn = get(conn, "/api/v1/conversations")
|
|
|
|
|
|
|
|
|
|
|
@ -78,14 +77,11 @@ defmodule Pleroma.Web.MastodonAPI.ConversationControllerTest do
|
|
|
|
|
|
|
|
|
|
|
|
assert [
|
|
|
|
assert [
|
|
|
|
%{
|
|
|
|
%{
|
|
|
|
"accounts" => res_accounts,
|
|
|
|
"accounts" => [account]
|
|
|
|
"last_status" => res_last_status
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
] = response
|
|
|
|
] = response
|
|
|
|
|
|
|
|
|
|
|
|
account_ids = Enum.map(res_accounts, & &1["id"])
|
|
|
|
assert user_one.id == account["id"]
|
|
|
|
assert length(res_accounts) == 1
|
|
|
|
|
|
|
|
assert user_one.id in account_ids
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
test "observes limit params", %{
|
|
|
|
test "observes limit params", %{
|
|
|
|