summaryrefslogtreecommitdiff
path: root/test/pleroma/web/twitter_api/controller_test.exs
diff options
context:
space:
mode:
Diffstat (limited to 'test/pleroma/web/twitter_api/controller_test.exs')
-rw-r--r--test/pleroma/web/twitter_api/controller_test.exs22
1 files changed, 10 insertions, 12 deletions
diff --git a/test/pleroma/web/twitter_api/controller_test.exs b/test/pleroma/web/twitter_api/controller_test.exs
index 464d0ea2e..583c904b2 100644
--- a/test/pleroma/web/twitter_api/controller_test.exs
+++ b/test/pleroma/web/twitter_api/controller_test.exs
@@ -1,13 +1,13 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# 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)
@@ -66,10 +64,10 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do
setup do
{:ok, user} =
insert(:user)
- |> User.confirmation_changeset(need_confirmation: true)
+ |> User.confirmation_changeset(set_confirmation: false)
|> Repo.update()
- assert user.confirmation_pending
+ refute user.is_confirmed
[user: user]
end
@@ -85,7 +83,7 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do
user = User.get_cached_by_id(user.id)
- refute user.confirmation_pending
+ assert user.is_confirmed
refute user.confirmation_token
end