X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fweb%2Fmastodon_api%2Fmastodon_api_test.exs;h=0c5a38bf649e0968b8861c98597f1e167b479af4;hb=474aba984f2184d4f028c56f687d1a12f69d5c47;hp=b4c0427c9d4d2b18f42b8b67b9bc06799d753a52;hpb=39e6b16432f848dd7b789dcf3c233e8ec33ecb89;p=akkoma
diff --git a/test/web/mastodon_api/mastodon_api_test.exs b/test/web/mastodon_api/mastodon_api_test.exs
index b4c0427c9..0c5a38bf6 100644
--- a/test/web/mastodon_api/mastodon_api_test.exs
+++ b/test/web/mastodon_api/mastodon_api_test.exs
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.MastodonAPI.MastodonAPITest do
@@ -8,17 +8,16 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPITest do
alias Pleroma.Notification
alias Pleroma.ScheduledActivity
alias Pleroma.User
+ alias Pleroma.Web.CommonAPI
alias Pleroma.Web.MastodonAPI.MastodonAPI
- alias Pleroma.Web.TwitterAPI.TwitterAPI
import Pleroma.Factory
describe "follow/3" do
- test "returns error when user deactivated" do
+ test "returns error when followed user is deactivated" do
follower = insert(:user)
- user = insert(:user, local: true, info: %{deactivated: true})
- {:error, error} = MastodonAPI.follow(follower, user)
- assert error == "Could not follow user: You are deactivated."
+ user = insert(:user, local: true, deactivated: true)
+ assert {:error, _error} = MastodonAPI.follow(follower, user)
end
test "following for user" do
@@ -75,8 +74,9 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPITest do
User.subscribe(subscriber, user)
- {:ok, status} = TwitterAPI.create_status(user, %{"status" => "Akariiiin"})
- {:ok, status1} = TwitterAPI.create_status(user, %{"status" => "Magi"})
+ {:ok, status} = CommonAPI.post(user, %{status: "Akariiiin"})
+
+ {:ok, status1} = CommonAPI.post(user, %{status: "Magi"})
{:ok, [notification]} = Notification.create_notifications(status)
{:ok, [notification1]} = Notification.create_notifications(status1)
res = MastodonAPI.get_notifications(subscriber)