From 1b57522bba4bbe2843b7c68d37e0530387e5b8f3 Mon Sep 17 00:00:00 2001 From: lain Date: Mon, 2 Apr 2018 13:13:04 +0200 Subject: Fix some test stuff. --- test/web/twitter_api/twitter_api_controller_test.exs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'test/web/twitter_api/twitter_api_controller_test.exs') diff --git a/test/web/twitter_api/twitter_api_controller_test.exs b/test/web/twitter_api/twitter_api_controller_test.exs index 5abdc2e0e..2cbcfd086 100644 --- a/test/web/twitter_api/twitter_api_controller_test.exs +++ b/test/web/twitter_api/twitter_api_controller_test.exs @@ -600,8 +600,9 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do |> assign(:user, user) |> get("/api/statuses/followers") - assert json_response(conn, 200) == - UserView.render("index.json", %{users: [follower_one, follower_two], for: user}) + expected = UserView.render("index.json", %{users: [follower_one, follower_two], for: user}) + result = json_response(conn, 200) + assert Enum.sort(expected) == Enum.sort(result) end end @@ -620,12 +621,9 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do |> assign(:user, user) |> get("/api/statuses/friends") - assert MapSet.equal?( - MapSet.new(json_response(conn, 200)), - MapSet.new( - UserView.render("index.json", %{users: [followed_one, followed_two], for: user}) - ) - ) + expected = UserView.render("index.json", %{users: [followed_one, followed_two], for: user}) + result = json_response(conn, 200) + assert Enum.sort(expected) == Enum.sort(result) end test "it returns a given user's friends with user_id", %{conn: conn} do -- cgit v1.2.3