giant massive dep upgrade and dialyxir-found error emporium (#371)
[akkoma] / test / pleroma / web / pleroma_api / controllers / emoji_file_controller_test.exs
index 61a44b8bafb3e0759844ef65a98b1592b59035a1..0d3d38b33c76733e83764a0d6a794f66026f5c6d 100644 (file)
@@ -28,7 +28,7 @@ defmodule Pleroma.Web.PleromaAPI.EmojiFileControllerTest do
     {:ok, %{admin_conn: admin_conn}}
   end
 
-  describe "POST/PATCH/DELETE /api/pleroma/emoji/packs/files?name=:name" do
+  describe "POST/PATCH/DELETE /api/v1/pleroma/emoji/packs/files?name=:name" do
     setup do
       pack_file = "#{@emoji_path}/test_pack/pack.json"
       original_content = File.read!(pack_file)
@@ -55,7 +55,7 @@ defmodule Pleroma.Web.PleromaAPI.EmojiFileControllerTest do
       resp =
         admin_conn
         |> put_req_header("content-type", "multipart/form-data")
-        |> post("/api/pleroma/emoji/packs/files?name=test_pack", %{
+        |> post("/api/v1/pleroma/emoji/packs/files?name=test_pack", %{
           file: %Plug.Upload{
             content_type: "application/zip",
             filename: "emojis.zip",
@@ -82,7 +82,7 @@ defmodule Pleroma.Web.PleromaAPI.EmojiFileControllerTest do
     test "create shortcode exists", %{admin_conn: admin_conn} do
       assert admin_conn
              |> put_req_header("content-type", "multipart/form-data")
-             |> post("/api/pleroma/emoji/packs/files?name=test_pack", %{
+             |> post("/api/v1/pleroma/emoji/packs/files?name=test_pack", %{
                shortcode: "blank",
                filename: "dir/blank.png",
                file: %Plug.Upload{
@@ -100,7 +100,7 @@ defmodule Pleroma.Web.PleromaAPI.EmojiFileControllerTest do
 
       assert admin_conn
              |> put_req_header("content-type", "multipart/form-data")
-             |> post("/api/pleroma/emoji/packs/files?name=test_pack", %{
+             |> post("/api/v1/pleroma/emoji/packs/files?name=test_pack", %{
                shortcode: "blank3",
                filename: "dir/blank.png",
                file: %Plug.Upload{
@@ -118,7 +118,7 @@ defmodule Pleroma.Web.PleromaAPI.EmojiFileControllerTest do
 
       assert admin_conn
              |> put_req_header("content-type", "multipart/form-data")
-             |> patch("/api/pleroma/emoji/packs/files?name=test_pack", %{
+             |> patch("/api/v1/pleroma/emoji/packs/files?name=test_pack", %{
                shortcode: "blank",
                new_shortcode: "blank2",
                new_filename: "dir_2/blank_3.png"
@@ -134,7 +134,7 @@ defmodule Pleroma.Web.PleromaAPI.EmojiFileControllerTest do
 
       assert admin_conn
              |> put_req_header("content-type", "multipart/form-data")
-             |> post("/api/pleroma/emoji/packs/files?name=test_pack", %{
+             |> post("/api/v1/pleroma/emoji/packs/files?name=test_pack", %{
                shortcode: "blank3",
                filename: "dir/blank.png",
                file: %Plug.Upload{
@@ -152,7 +152,7 @@ defmodule Pleroma.Web.PleromaAPI.EmojiFileControllerTest do
 
       assert admin_conn
              |> put_req_header("content-type", "multipart/form-data")
-             |> patch("/api/pleroma/emoji/packs/files?name=test_pack", %{
+             |> patch("/api/v1/pleroma/emoji/packs/files?name=test_pack", %{
                shortcode: "blank3",
                new_shortcode: "blank4",
                new_filename: "dir_2/blank_3.png",
@@ -170,7 +170,7 @@ defmodule Pleroma.Web.PleromaAPI.EmojiFileControllerTest do
     test "with empty filename", %{admin_conn: admin_conn} do
       assert admin_conn
              |> put_req_header("content-type", "multipart/form-data")
-             |> post("/api/pleroma/emoji/packs/files?name=test_pack", %{
+             |> post("/api/v1/pleroma/emoji/packs/files?name=test_pack", %{
                shortcode: "blank2",
                filename: "",
                file: %Plug.Upload{
@@ -186,7 +186,7 @@ defmodule Pleroma.Web.PleromaAPI.EmojiFileControllerTest do
     test "add file with not loaded pack", %{admin_conn: admin_conn} do
       assert admin_conn
              |> put_req_header("content-type", "multipart/form-data")
-             |> post("/api/pleroma/emoji/packs/files?name=not_loaded", %{
+             |> post("/api/v1/pleroma/emoji/packs/files?name=not_loaded", %{
                shortcode: "blank3",
                filename: "dir/blank.png",
                file: %Plug.Upload{
@@ -209,7 +209,7 @@ defmodule Pleroma.Web.PleromaAPI.EmojiFileControllerTest do
       ]) do
         assert admin_conn
                |> put_req_header("content-type", "multipart/form-data")
-               |> post("/api/pleroma/emoji/packs/files?name=not_loaded", %{
+               |> post("/api/v1/pleroma/emoji/packs/files?name=not_loaded", %{
                  shortcode: "blank3",
                  filename: "dir/blank.png",
                  file: %Plug.Upload{
@@ -226,7 +226,7 @@ defmodule Pleroma.Web.PleromaAPI.EmojiFileControllerTest do
 
     test "remove file with not loaded pack", %{admin_conn: admin_conn} do
       assert admin_conn
-             |> delete("/api/pleroma/emoji/packs/files?name=not_loaded&shortcode=blank3")
+             |> delete("/api/v1/pleroma/emoji/packs/files?name=not_loaded&shortcode=blank3")
              |> json_response_and_validate_schema(:not_found) == %{
                "error" => "pack \"not_loaded\" is not found"
              }
@@ -234,7 +234,7 @@ defmodule Pleroma.Web.PleromaAPI.EmojiFileControllerTest do
 
     test "remove file with empty shortcode", %{admin_conn: admin_conn} do
       assert admin_conn
-             |> delete("/api/pleroma/emoji/packs/files?name=not_loaded&shortcode=")
+             |> delete("/api/v1/pleroma/emoji/packs/files?name=not_loaded&shortcode=")
              |> json_response_and_validate_schema(:not_found) == %{
                "error" => "pack \"not_loaded\" is not found"
              }
@@ -243,7 +243,7 @@ defmodule Pleroma.Web.PleromaAPI.EmojiFileControllerTest do
     test "update file with not loaded pack", %{admin_conn: admin_conn} do
       assert admin_conn
              |> put_req_header("content-type", "multipart/form-data")
-             |> patch("/api/pleroma/emoji/packs/files?name=not_loaded", %{
+             |> patch("/api/v1/pleroma/emoji/packs/files?name=not_loaded", %{
                shortcode: "blank4",
                new_shortcode: "blank3",
                new_filename: "dir_2/blank_3.png"
@@ -256,7 +256,7 @@ defmodule Pleroma.Web.PleromaAPI.EmojiFileControllerTest do
     test "new with shortcode as file with update", %{admin_conn: admin_conn} do
       assert admin_conn
              |> put_req_header("content-type", "multipart/form-data")
-             |> post("/api/pleroma/emoji/packs/files?name=test_pack", %{
+             |> post("/api/v1/pleroma/emoji/packs/files?name=test_pack", %{
                shortcode: "blank4",
                filename: "dir/blank.png",
                file: %Plug.Upload{
@@ -274,7 +274,7 @@ defmodule Pleroma.Web.PleromaAPI.EmojiFileControllerTest do
 
       assert admin_conn
              |> put_req_header("content-type", "multipart/form-data")
-             |> patch("/api/pleroma/emoji/packs/files?name=test_pack", %{
+             |> patch("/api/v1/pleroma/emoji/packs/files?name=test_pack", %{
                shortcode: "blank4",
                new_shortcode: "blank3",
                new_filename: "dir_2/blank_3.png"
@@ -289,7 +289,7 @@ defmodule Pleroma.Web.PleromaAPI.EmojiFileControllerTest do
       assert File.exists?("#{@emoji_path}/test_pack/dir_2/blank_3.png")
 
       assert admin_conn
-             |> delete("/api/pleroma/emoji/packs/files?name=test_pack&shortcode=blank3")
+             |> delete("/api/v1/pleroma/emoji/packs/files?name=test_pack&shortcode=blank3")
              |> json_response_and_validate_schema(200) == %{
                "blank" => "blank.png",
                "blank2" => "blank2.png"
@@ -311,7 +311,7 @@ defmodule Pleroma.Web.PleromaAPI.EmojiFileControllerTest do
 
       assert admin_conn
              |> put_req_header("content-type", "multipart/form-data")
-             |> post("/api/pleroma/emoji/packs/files?name=test_pack", %{
+             |> post("/api/v1/pleroma/emoji/packs/files?name=test_pack", %{
                shortcode: "blank_url",
                file: "https://test-blank/blank_url.png"
              })
@@ -331,7 +331,7 @@ defmodule Pleroma.Web.PleromaAPI.EmojiFileControllerTest do
 
       assert admin_conn
              |> put_req_header("content-type", "multipart/form-data")
-             |> post("/api/pleroma/emoji/packs/files?name=test_pack", %{
+             |> post("/api/v1/pleroma/emoji/packs/files?name=test_pack", %{
                file: %Plug.Upload{
                  filename: "shortcode.png",
                  path: "#{Pleroma.Config.get([:instance, :static_dir])}/add/shortcode.png"
@@ -346,7 +346,7 @@ defmodule Pleroma.Web.PleromaAPI.EmojiFileControllerTest do
 
     test "remove non existing shortcode in pack.json", %{admin_conn: admin_conn} do
       assert admin_conn
-             |> delete("/api/pleroma/emoji/packs/files?name=test_pack&shortcode=blank3")
+             |> delete("/api/v1/pleroma/emoji/packs/files?name=test_pack&shortcode=blank3")
              |> json_response_and_validate_schema(:bad_request) == %{
                "error" => "Emoji \"blank3\" does not exist"
              }
@@ -355,7 +355,7 @@ defmodule Pleroma.Web.PleromaAPI.EmojiFileControllerTest do
     test "update non existing emoji", %{admin_conn: admin_conn} do
       assert admin_conn
              |> put_req_header("content-type", "multipart/form-data")
-             |> patch("/api/pleroma/emoji/packs/files?name=test_pack", %{
+             |> patch("/api/v1/pleroma/emoji/packs/files?name=test_pack", %{
                shortcode: "blank3",
                new_shortcode: "blank4",
                new_filename: "dir_2/blank_3.png"
@@ -371,7 +371,7 @@ defmodule Pleroma.Web.PleromaAPI.EmojiFileControllerTest do
              } =
                admin_conn
                |> put_req_header("content-type", "multipart/form-data")
-               |> patch("/api/pleroma/emoji/packs/files?name=test_pack", %{
+               |> patch("/api/v1/pleroma/emoji/packs/files?name=test_pack", %{
                  shortcode: "blank",
                  new_filename: "dir_2/blank_3.png"
                })