X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fpleroma%2Fweb%2Ftwitter_api%2Fcontroller_test.exs;h=b3ca676373d6f7439c9a8f0a5927a041b00ea158;hb=4134abef63e1165f5701741c1012e64cb908654c;hp=464d0ea2eed10825ed7210df2b4c323cc2ccb195;hpb=073ad7e6d91884f3c972f903d936f029c7a884e6;p=akkoma diff --git a/test/pleroma/web/twitter_api/controller_test.exs b/test/pleroma/web/twitter_api/controller_test.exs index 464d0ea2e..b3ca67637 100644 --- a/test/pleroma/web/twitter_api/controller_test.exs +++ b/test/pleroma/web/twitter_api/controller_test.exs @@ -3,11 +3,11 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.TwitterAPI.ControllerTest do - use Pleroma.Web.ConnCase + use Pleroma.Web.ConnCase, async: true - alias Pleroma.Builders.ActivityBuilder alias Pleroma.Repo alias Pleroma.User + alias Pleroma.Web.CommonAPI alias Pleroma.Web.OAuth.Token import Pleroma.Factory @@ -36,22 +36,20 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do other_user = insert(:user) {:ok, _activity} = - ActivityBuilder.insert(%{"to" => [current_user.ap_id]}, %{user: other_user}) + CommonAPI.post(other_user, %{ + status: "Hey @#{current_user.nickname}" + }) response_conn = conn - |> assign(:user, current_user) |> get("/api/v1/notifications") - [notification] = response = json_response(response_conn, 200) - - assert length(response) == 1 + [notification] = json_response(response_conn, 200) assert notification["pleroma"]["is_seen"] == false response_conn = conn - |> assign(:user, current_user) |> post("/api/qvitter/statuses/notifications/read", %{"latest_id" => notification["id"]}) [notification] = response = json_response(response_conn, 200)