diff options
author | Sadposter <hannah+pleroma@coffee-and-dreams.uk> | 2019-04-10 10:44:54 +0100 |
---|---|---|
committer | Sadposter <hannah+pleroma@coffee-and-dreams.uk> | 2019-04-10 10:44:54 +0100 |
commit | be8350baa2f8c9cf9be3f53ee4a0041dada1386f (patch) | |
tree | 8414fc2108941ccadd9b9fd4dd37c9d3cf731399 /test/web/twitter_api/util_controller_test.exs | |
parent | 589629cf3e1bee9a4f6e92b8456d8614eff73c89 (diff) | |
parent | c8440b5e0c97c5d5c03e4b99e30a61df6ab95319 (diff) | |
download | pleroma-be8350baa2f8c9cf9be3f53ee4a0041dada1386f.tar.gz pleroma-be8350baa2f8c9cf9be3f53ee4a0041dada1386f.zip |
Merge branch 'develop' into feature/user-status-subscriptions
Diffstat (limited to 'test/web/twitter_api/util_controller_test.exs')
-rw-r--r-- | test/web/twitter_api/util_controller_test.exs | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/web/twitter_api/util_controller_test.exs b/test/web/twitter_api/util_controller_test.exs index e4dd97d46..a4b3d651a 100644 --- a/test/web/twitter_api/util_controller_test.exs +++ b/test/web/twitter_api/util_controller_test.exs @@ -3,6 +3,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do alias Pleroma.Notification alias Pleroma.Repo + alias Pleroma.User alias Pleroma.Web.CommonAPI import Pleroma.Factory @@ -79,6 +80,26 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do end end + describe "PUT /api/pleroma/notification_settings" do + test "it updates notification settings", %{conn: conn} do + user = insert(:user) + + conn + |> assign(:user, user) + |> put("/api/pleroma/notification_settings", %{ + "remote" => false, + "followers" => false, + "bar" => 1 + }) + |> json_response(:ok) + + user = Repo.get(User, user.id) + + assert %{"remote" => false, "local" => true, "followers" => false, "follows" => true} == + user.info.notification_settings + end + end + describe "GET /api/statusnet/config.json" do test "returns the state of safe_dm_mentions flag", %{conn: conn} do option = Pleroma.Config.get([:instance, :safe_dm_mentions]) @@ -170,6 +191,24 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do end end + describe "/api/pleroma/emoji" do + test "returns json with custom emoji with tags", %{conn: conn} do + emoji = + conn + |> get("/api/pleroma/emoji") + |> json_response(200) + + assert Enum.all?(emoji, fn + {_key, + %{ + "image_url" => url, + "tags" => tags + }} -> + is_binary(url) and is_list(tags) + end) + end + end + describe "GET /ostatus_subscribe?acct=...." do test "adds status to pleroma instance if the `acct` is a status", %{conn: conn} do conn = |