test: user: add a test for whether user search returns a user or not
authorWilliam Pitcock <nenolod@dereferenced.org>
Thu, 14 Feb 2019 19:59:12 +0000 (19:59 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Thu, 14 Feb 2019 20:05:08 +0000 (20:05 +0000)
test/user_test.exs

index 58587bd822896be326ebc338eb6ce02820a2aa06..a99b79a0de773e73d369e766197234fe368d353a 100644 (file)
@@ -878,6 +878,16 @@ defmodule Pleroma.UserTest do
         assert [] == User.search(query)
       end)
     end
+
+    test "works with URIs" do
+      results = User.search("http://mastodon.example.org/users/admin", true)
+      result = results |> List.first()
+
+      user = User.get_by_ap_id("http://mastodon.example.org/users/admin")
+
+      assert length(results) == 1
+      assert user == result |> Map.put(:search_rank, nil)
+    end
   end
 
   test "auth_active?/1 works correctly" do