From f5ef7fe43bb42d5cd641666194f1d780499e1e09 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Mon, 7 Jun 2021 16:06:53 -0500 Subject: [PATCH 1/3] Fix test warnings --- .../controllers/config_controller_test.exs | 43 +++++++++---------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/test/pleroma/web/admin_api/controllers/config_controller_test.exs b/test/pleroma/web/admin_api/controllers/config_controller_test.exs index d8ca07cd3..7c786c389 100644 --- a/test/pleroma/web/admin_api/controllers/config_controller_test.exs +++ b/test/pleroma/web/admin_api/controllers/config_controller_test.exs @@ -1427,30 +1427,27 @@ test "custom instance thumbnail", %{conn: conn} do ] } - res = - assert conn - |> put_req_header("content-type", "application/json") - |> post("/api/pleroma/admin/config", %{"configs" => [params]}) - |> json_response_and_validate_schema(200) + assert conn + |> put_req_header("content-type", "application/json") + |> post("/api/pleroma/admin/config", %{"configs" => [params]}) + |> json_response_and_validate_schema(200) == + %{ + "configs" => [ + %{ + "db" => [":instance_thumbnail"], + "group" => ":pleroma", + "key" => ":instance", + "value" => params["value"] + } + ], + "need_reboot" => false + } - assert res == %{ - "configs" => [ - %{ - "db" => [":instance_thumbnail"], - "group" => ":pleroma", - "key" => ":instance", - "value" => params["value"] - } - ], - "need_reboot" => false - } - - _res = - assert conn - |> get("/api/v1/instance") - |> json_response_and_validate_schema(200) - - assert res = %{"thumbnail" => "https://example.com/media/new_thumbnail.jpg"} + assert conn + |> get("/api/v1/instance") + |> json_response_and_validate_schema(200) + |> Map.take(["thumbnail"]) == + %{"thumbnail" => "https://example.com/media/new_thumbnail.jpg"} end test "Concurrent Limiter", %{conn: conn} do From a5ae0432ed2353c714a4c212e418e6cc0ea91eb6 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Mon, 7 Jun 2021 16:09:47 -0500 Subject: [PATCH 2/3] Test was named incorrectly and did not execute --- .../pleroma/web/{shout_channel_test.ex => shout_channel_test.exs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test/pleroma/web/{shout_channel_test.ex => shout_channel_test.exs} (100%) diff --git a/test/pleroma/web/shout_channel_test.ex b/test/pleroma/web/shout_channel_test.exs similarity index 100% rename from test/pleroma/web/shout_channel_test.ex rename to test/pleroma/web/shout_channel_test.exs From 017f947fc111eb98c964cd984fdb073623407b0e Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Mon, 7 Jun 2021 16:10:24 -0500 Subject: [PATCH 3/3] Channel name was incorrect. We left it as chat:public for backwards compatibility. --- test/pleroma/web/shout_channel_test.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/pleroma/web/shout_channel_test.exs b/test/pleroma/web/shout_channel_test.exs index a266543d2..5c86efe9f 100644 --- a/test/pleroma/web/shout_channel_test.exs +++ b/test/pleroma/web/shout_channel_test.exs @@ -14,7 +14,7 @@ defmodule Pleroma.Web.ShoutChannelTest do {:ok, _, socket} = socket(UserSocket, "", %{user_name: user.nickname}) - |> subscribe_and_join(ShoutChannel, "shout:public") + |> subscribe_and_join(ShoutChannel, "chat:public") {:ok, socket: socket} end