summaryrefslogtreecommitdiff
path: root/test/web/emoji_api_controller_test.exs
diff options
context:
space:
mode:
authorEkaterina Vaartis <vaartis@cock.li>2019-09-11 22:58:55 +0300
committerEkaterina Vaartis <vaartis@cock.li>2019-09-19 00:16:33 +0300
commit36f2275dc9f6c58163e4e07f8ace9d75e96033c7 (patch)
tree2d8859bda1e179020a557f67ae369dcf0a23834b /test/web/emoji_api_controller_test.exs
parent74fb6d864760ccaa18b9a20d148c590254779454 (diff)
downloadpleroma-36f2275dc9f6c58163e4e07f8ace9d75e96033c7.tar.gz
pleroma-36f2275dc9f6c58163e4e07f8ace9d75e96033c7.zip
A feature for shareable emoji packs, use it in download_from & tests
Diffstat (limited to 'test/web/emoji_api_controller_test.exs')
-rw-r--r--test/web/emoji_api_controller_test.exs22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/web/emoji_api_controller_test.exs b/test/web/emoji_api_controller_test.exs
index 38d11cdce..1af4d3720 100644
--- a/test/web/emoji_api_controller_test.exs
+++ b/test/web/emoji_api_controller_test.exs
@@ -54,6 +54,12 @@ defmodule Pleroma.Web.PleromaAPI.EmojiAPIControllerTest do
end)
mock(fn
+ %{method: :get, url: "https://old-instance/nodeinfo/2.1.json"} ->
+ json(%{features: []})
+
+ %{method: :get, url: "https://example.com/nodeinfo/2.1.json"} ->
+ json(%{features: ["shareable_emoji_packs"]})
+
%{
method: :get,
url: "https://example.com/api/pleroma/emoji/packs/list"
@@ -87,6 +93,22 @@ defmodule Pleroma.Web.PleromaAPI.EmojiAPIControllerTest do
conn = build_conn() |> assign(:user, admin)
+ assert (conn
+ |> put_req_header("content-type", "application/json")
+ |> post(
+ emoji_api_path(
+ conn,
+ :download_from
+ ),
+ %{
+ instance_address: "https://old-instance",
+ pack_name: "test_pack",
+ as: "test_pack2"
+ }
+ |> Jason.encode!()
+ )
+ |> json_response(500))["error"] =~ "does not support"
+
assert conn
|> put_req_header("content-type", "application/json")
|> post(