Fix test warnings
authorMark Felder <feld@feld.me>
Mon, 7 Jun 2021 21:06:53 +0000 (16:06 -0500)
committerMark Felder <feld@feld.me>
Mon, 7 Jun 2021 21:06:53 +0000 (16:06 -0500)
test/pleroma/web/admin_api/controllers/config_controller_test.exs

index d8ca07cd37a8a030a4c939226dfe09fc7bd66015..7c786c389c248f333263e9982e0fcf532ba69204 100644 (file)
@@ -1427,30 +1427,27 @@ defmodule Pleroma.Web.AdminAPI.ConfigControllerTest 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 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 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 = %{"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