We do not guarantee the order of elements when we search
authorMaxim Filippov <colixer@gmail.com>
Sat, 2 Mar 2019 14:32:40 +0000 (17:32 +0300)
committerMaxim Filippov <colixer@gmail.com>
Sat, 2 Mar 2019 14:32:40 +0000 (17:32 +0300)
test/user_test.exs

index 4f9de4e3148704dfccec98daae94d2b2e8c3fe73..188ab1a5ca44554612bc477203e69a97f1dd120a 100644 (file)
@@ -901,8 +901,8 @@ defmodule Pleroma.UserTest do
       {:ok, follower} = User.follow(follower, u1)
       {:ok, u1} = User.follow(u1, friend)
 
-      assert [friend.id, follower.id, u2.id] ==
-               Enum.map(User.search("doe", resolve: false, for_user: u1), & &1.id)
+      assert [friend.id, follower.id, u2.id] --
+               Enum.map(User.search("doe", resolve: false, for_user: u1), & &1.id) == []
     end
 
     test "finds a user whose name is nil" do