diff options
Diffstat (limited to 'test/web/mastodon_api')
-rw-r--r-- | test/web/mastodon_api/account_view_test.exs | 6 | ||||
-rw-r--r-- | test/web/mastodon_api/list_view_test.exs | 1 | ||||
-rw-r--r-- | test/web/mastodon_api/mastodon_api_controller_test.exs | 28 | ||||
-rw-r--r-- | test/web/mastodon_api/mastodon_socket_test.exs | 2 | ||||
-rw-r--r-- | test/web/mastodon_api/status_view_test.exs | 4 |
5 files changed, 23 insertions, 18 deletions
diff --git a/test/web/mastodon_api/account_view_test.exs b/test/web/mastodon_api/account_view_test.exs index a2d3a2547..3cb9b9c5b 100644 --- a/test/web/mastodon_api/account_view_test.exs +++ b/test/web/mastodon_api/account_view_test.exs @@ -54,7 +54,8 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do note: "", privacy: "public", sensitive: false - } + }, + pleroma: %{tags: []} } assert expected == AccountView.render("account.json", %{user: user}) @@ -91,7 +92,8 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do note: "", privacy: "public", sensitive: false - } + }, + pleroma: %{tags: []} } assert expected == AccountView.render("account.json", %{user: user}) diff --git a/test/web/mastodon_api/list_view_test.exs b/test/web/mastodon_api/list_view_test.exs index 5e36872ed..a12acc2b2 100644 --- a/test/web/mastodon_api/list_view_test.exs +++ b/test/web/mastodon_api/list_view_test.exs @@ -2,7 +2,6 @@ defmodule Pleroma.Web.MastodonAPI.ListViewTest do use Pleroma.DataCase import Pleroma.Factory alias Pleroma.Web.MastodonAPI.ListView - alias Pleroma.List test "Represent a list" do user = insert(:user) diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs index 092f0c9fc..e8275d4ab 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -5,7 +5,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do alias Pleroma.{Repo, User, Object, Activity, Notification} alias Pleroma.Web.{OStatus, CommonAPI} alias Pleroma.Web.ActivityPub.ActivityPub - + alias Pleroma.Web.MastodonAPI.FilterView import Pleroma.Factory import ExUnit.CaptureLog import Tesla.Mock @@ -351,12 +351,18 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do {:ok, filter_one} = Pleroma.Filter.create(query_one) {:ok, filter_two} = Pleroma.Filter.create(query_two) - conn = + response = conn |> assign(:user, user) |> get("/api/v1/filters") - - assert response = json_response(conn, 200) + |> json_response(200) + + assert response == + render_json( + FilterView, + "filters.json", + filters: [filter_two, filter_one] + ) end test "get a filter", %{conn: conn} do @@ -389,7 +395,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do context: ["home"] } - {:ok, filter} = Pleroma.Filter.create(query) + {:ok, _filter} = Pleroma.Filter.create(query) new = %Pleroma.Filter{ phrase: "nii", @@ -554,7 +560,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do other_user = insert(:user) {:ok, activity_one} = TwitterAPI.create_status(other_user, %{"status" => "Marisa is cute."}) - {:ok, activity_two} = + {:ok, _activity_two} = TwitterAPI.create_status(other_user, %{ "status" => "Marisa is cute.", "visibility" => "private" @@ -854,7 +860,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do user = insert(:user, %{info: %Pleroma.User.Info{locked: true}}) other_user = insert(:user) - {:ok, activity} = ActivityPub.follow(other_user, user) + {:ok, _activity} = ActivityPub.follow(other_user, user) user = Repo.get(User, user.id) other_user = Repo.get(User, other_user.id) @@ -874,7 +880,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do user = insert(:user, %{info: %Pleroma.User.Info{locked: true}}) other_user = insert(:user) - {:ok, activity} = ActivityPub.follow(other_user, user) + {:ok, _activity} = ActivityPub.follow(other_user, user) user = Repo.get(User, user.id) other_user = Repo.get(User, other_user.id) @@ -911,7 +917,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do user = insert(:user, %{info: %Pleroma.User.Info{locked: true}}) other_user = insert(:user) - {:ok, activity} = ActivityPub.follow(other_user, user) + {:ok, _activity} = ActivityPub.follow(other_user, user) conn = build_conn() @@ -1015,7 +1021,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do test "getting followers, hide_network", %{conn: conn} do user = insert(:user) other_user = insert(:user, %{info: %{hide_network: true}}) - {:ok, user} = User.follow(user, other_user) + {:ok, _user} = User.follow(user, other_user) conn = conn @@ -1027,7 +1033,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do test "getting followers, hide_network, same user requesting", %{conn: conn} do user = insert(:user) other_user = insert(:user, %{info: %{hide_network: true}}) - {:ok, user} = User.follow(user, other_user) + {:ok, _user} = User.follow(user, other_user) conn = conn diff --git a/test/web/mastodon_api/mastodon_socket_test.exs b/test/web/mastodon_api/mastodon_socket_test.exs index c7d71defc..5d9b96861 100644 --- a/test/web/mastodon_api/mastodon_socket_test.exs +++ b/test/web/mastodon_api/mastodon_socket_test.exs @@ -1,9 +1,7 @@ defmodule Pleroma.Web.MastodonApi.MastodonSocketTest do use Pleroma.DataCase - alias Pleroma.Web.MastodonApi.MastodonSocket alias Pleroma.Web.{Streamer, CommonAPI} - alias Pleroma.User import Pleroma.Factory diff --git a/test/web/mastodon_api/status_view_test.exs b/test/web/mastodon_api/status_view_test.exs index 9e69b3189..d10d59d6c 100644 --- a/test/web/mastodon_api/status_view_test.exs +++ b/test/web/mastodon_api/status_view_test.exs @@ -24,7 +24,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do note |> Map.put(:data, data) - user = User.get_cached_by_ap_id(note.data["actor"]) + User.get_cached_by_ap_id(note.data["actor"]) status = StatusView.render("status.json", %{activity: note}) @@ -62,7 +62,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do visibility: "public", media_attachments: [], mentions: [], - tags: [], + tags: note.data["object"]["tag"], application: %{ name: "Web", website: nil |