From 3d29fc5462e4b6bd9f0ee1f343ce971ef8606381 Mon Sep 17 00:00:00 2001 From: eal Date: Mon, 20 Nov 2017 19:16:43 +0200 Subject: [PATCH] Make /api/friends/ids test deterministic. --- test/web/twitter_api/twitter_api_controller_test.exs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/web/twitter_api/twitter_api_controller_test.exs b/test/web/twitter_api/twitter_api_controller_test.exs index 4b8fa85a5..d12ade132 100644 --- a/test/web/twitter_api/twitter_api_controller_test.exs +++ b/test/web/twitter_api/twitter_api_controller_test.exs @@ -548,8 +548,8 @@ test "it returns a user's friends", %{conn: conn} 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