diff options
| author | Maksim Pechnikov <parallel588@gmail.com> | 2018-12-11 15:31:52 +0300 | 
|---|---|---|
| committer | Maksim Pechnikov <parallel588@gmail.com> | 2018-12-12 09:09:19 +0300 | 
| commit | 89b3729afa130a62a47ed6372350ebfc5acb4064 (patch) | |
| tree | 89fba8fe2ed33bb25ef554f67e4659e255f81709 /test/web/mastodon_api | |
| parent | 2999a08e3590c43c623730b0cbf6b93045ac08c1 (diff) | |
| download | pleroma-89b3729afa130a62a47ed6372350ebfc5acb4064.tar.gz pleroma-89b3729afa130a62a47ed6372350ebfc5acb4064.zip  | |
fix warnings
Diffstat (limited to 'test/web/mastodon_api')
| -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 | 
3 files changed, 17 insertions, 14 deletions
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  | 
