Refactoring oauth response.
[akkoma] / test / web / twitter_api / util_controller_test.exs
index 66d89eee0bd0c0356b9a0699635cde14123a2230..14a8225f097caac84a6c9de636e77357930fa36f 100644 (file)
@@ -26,6 +26,21 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do
       assert response == "job started"
     end
 
+    test "it imports new-style mastodon follow lists", %{conn: conn} do
+      user1 = insert(:user)
+      user2 = insert(:user)
+
+      response =
+        conn
+        |> assign(:user, user1)
+        |> post("/api/pleroma/follow_import", %{
+          "list" => "Account address,Show boosts\n#{user2.ap_id},true"
+        })
+        |> json_response(:ok)
+
+      assert response == "job started"
+    end
+
     test "requires 'follow' permission", %{conn: conn} do
       token1 = insert(:oauth_token, scopes: ["read", "write"])
       token2 = insert(:oauth_token, scopes: ["follow"])
@@ -231,6 +246,12 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do
     end
   end
 
+  test "GET /api/pleroma/healthcheck", %{conn: conn} do
+    conn = get(conn, "/api/pleroma/healthcheck")
+
+    assert conn.status in [200, 503]
+  end
+
   describe "POST /api/pleroma/disable_account" do
     test "it returns HTTP 200", %{conn: conn} do
       user = insert(:user)