X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fweb%2Fmastodon_api%2Fmastodon_api_test.exs;h=cb971806abf402df60fd9b28ae1525fa589158de;hb=72ef6cc4f2f601e26ba84c16ad2c91bd72867629;hp=b4c0427c9d4d2b18f42b8b67b9bc06799d753a52;hpb=560dbad538ba978d00116b1b037502ba2185cb5e;p=akkoma
diff --git a/test/web/mastodon_api/mastodon_api_test.exs b/test/web/mastodon_api/mastodon_api_test.exs
index b4c0427c9..cb971806a 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,17 @@ 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})
+ user = insert(:user, local: true, deactivated: true)
{:error, error} = MastodonAPI.follow(follower, user)
- assert error == "Could not follow user: You are deactivated."
+ assert error == "Could not follow user: #{user.nickname} is deactivated."
end
test "following for user" do
@@ -75,8 +75,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)