diff options
Diffstat (limited to 'test/web/mastodon_api')
| -rw-r--r-- | test/web/mastodon_api/mastodon_api_controller_test.exs | 11 | ||||
| -rw-r--r-- | test/web/mastodon_api/status_view_test.exs | 2 | 
2 files changed, 12 insertions, 1 deletions
| diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs index dd84052a3..8443dc856 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -10,6 +10,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do    alias Pleroma.Web.{OStatus, CommonAPI}    alias Pleroma.Web.ActivityPub.ActivityPub    alias Pleroma.Web.MastodonAPI.FilterView +  alias Ecto.Changeset    import Pleroma.Factory    import ExUnit.CaptureLog    import Tesla.Mock @@ -1483,6 +1484,16 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do      {:ok, _} = TwitterAPI.create_status(user, %{"status" => "cofe"}) +    # Stats should count users with missing or nil `info.deactivated` value +    user = Repo.get(User, user.id) +    info_change = Changeset.change(user.info, %{deactivated: nil}) + +    {:ok, _user} = +      user +      |> Changeset.change() +      |> Changeset.put_embed(:info, info_change) +      |> User.update_and_set_cache() +      Pleroma.Stats.update_stats()      conn = get(conn, "/api/v1/instance") diff --git a/test/web/mastodon_api/status_view_test.exs b/test/web/mastodon_api/status_view_test.exs index d30ae6149..e33479368 100644 --- a/test/web/mastodon_api/status_view_test.exs +++ b/test/web/mastodon_api/status_view_test.exs @@ -202,7 +202,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do          "https://peertube.moe/videos/watch/df5f464b-be8d-46fb-ad81-2d4c2d1630e3"        ) -    %Activity{} = activity = Activity.get_create_activity_by_object_ap_id(object.data["id"]) +    %Activity{} = activity = Activity.get_create_by_object_ap_id(object.data["id"])      represented = StatusView.render("status.json", %{for: user, activity: activity}) | 
