Make /api/friends/ids test deterministic.
authoreal <eal@waifu.club>
Mon, 20 Nov 2017 17:16:43 +0000 (19:16 +0200)
committereal <eal@waifu.club>
Mon, 20 Nov 2017 17:16:43 +0000 (19:16 +0200)
test/web/twitter_api/twitter_api_controller_test.exs

index 4b8fa85a54c655c52c6a1d834e40c86f609f0aed..d12ade1327e56a9509681a46dbcaae4b4900edbe 100644 (file)
@@ -548,8 +548,8 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do
       |> assign(:user, user)
       |> get("/api/friends/ids")
 
-      expected = Poison.encode!([followed_one.id, followed_two.id])
-      assert json_response(conn, 200) == expected
+      expected = [followed_one.id, followed_two.id]
+      assert MapSet.equal?(MapSet.new(Poison.decode!(json_response(conn, 200))), MapSet.new(expected))
     end
   end