Fix account endorsements test
Random failures were caused by the results sometimes being returned out of order.
This commit is contained in:
parent
b54b19a0f4
commit
113261146f
1 changed files with 5 additions and 1 deletions
|
|
@ -292,10 +292,14 @@ defmodule Pleroma.Web.PleromaAPI.AccountControllerTest do
|
|||
User.endorse(user1, user2)
|
||||
User.endorse(user1, user3)
|
||||
|
||||
[%{"id" => ^id2}, %{"id" => ^id3}] =
|
||||
response =
|
||||
conn
|
||||
|> get("/api/v1/pleroma/accounts/#{id1}/endorsements")
|
||||
|> json_response_and_validate_schema(200)
|
||||
|
||||
assert length(response) == 2
|
||||
assert Enum.any?(response, fn user -> user["id"] == id2 end)
|
||||
assert Enum.any?(response, fn user -> user["id"] == id3 end)
|
||||
end
|
||||
|
||||
test "returns 404 error when specified user is not exist", %{conn: conn} do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue