projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
AccountController: Remove unused `update_?` routes.
[akkoma]
/
test
/
web
/
pleroma_api
/
controllers
/
mascot_controller_test.exs
diff --git
a/test/web/pleroma_api/controllers/mascot_controller_test.exs
b/test/web/pleroma_api/controllers/mascot_controller_test.exs
index 617831b028f31bd038ad7e5c77ab844c0aa42540..e2ead6e154e85c77b215e069984f67a62c2d75e1 100644
(file)
--- a/
test/web/pleroma_api/controllers/mascot_controller_test.exs
+++ b/
test/web/pleroma_api/controllers/mascot_controller_test.exs
@@
-16,9
+16,12
@@
defmodule Pleroma.Web.PleromaAPI.MascotControllerTest do
filename: "sound.mp3"
}
filename: "sound.mp3"
}
- ret_conn = put(conn, "/api/v1/pleroma/mascot", %{"file" => non_image_file})
+ ret_conn =
+ conn
+ |> put_req_header("content-type", "multipart/form-data")
+ |> put("/api/v1/pleroma/mascot", %{"file" => non_image_file})
- assert json_response(ret_conn, 415)
+ assert json_response
_and_validate_schema
(ret_conn, 415)
file = %Plug.Upload{
content_type: "image/jpg",
file = %Plug.Upload{
content_type: "image/jpg",
@@
-26,9
+29,12
@@
defmodule Pleroma.Web.PleromaAPI.MascotControllerTest do
filename: "an_image.jpg"
}
filename: "an_image.jpg"
}
- conn = put(conn, "/api/v1/pleroma/mascot", %{"file" => file})
+ conn =
+ conn
+ |> put_req_header("content-type", "multipart/form-data")
+ |> put("/api/v1/pleroma/mascot", %{"file" => file})
- assert %{"id" => _, "type" => image} = json_response(conn, 200)
+ assert %{"id" => _, "type" => image} = json_response
_and_validate_schema
(conn, 200)
end
test "mascot retrieving" do
end
test "mascot retrieving" do
@@
-37,7
+43,7
@@
defmodule Pleroma.Web.PleromaAPI.MascotControllerTest do
# When user hasn't set a mascot, we should just get pleroma tan back
ret_conn = get(conn, "/api/v1/pleroma/mascot")
# When user hasn't set a mascot, we should just get pleroma tan back
ret_conn = get(conn, "/api/v1/pleroma/mascot")
- assert %{"url" => url} = json_response(ret_conn, 200)
+ assert %{"url" => url} = json_response
_and_validate_schema
(ret_conn, 200)
assert url =~ "pleroma-fox-tan-smol"
# When a user sets their mascot, we should get that back
assert url =~ "pleroma-fox-tan-smol"
# When a user sets their mascot, we should get that back
@@
-47,9
+53,12
@@
defmodule Pleroma.Web.PleromaAPI.MascotControllerTest do
filename: "an_image.jpg"
}
filename: "an_image.jpg"
}
- ret_conn = put(conn, "/api/v1/pleroma/mascot", %{"file" => file})
+ ret_conn =
+ conn
+ |> put_req_header("content-type", "multipart/form-data")
+ |> put("/api/v1/pleroma/mascot", %{"file" => file})
- assert json_response(ret_conn, 200)
+ assert json_response
_and_validate_schema
(ret_conn, 200)
user = User.get_cached_by_id(user.id)
user = User.get_cached_by_id(user.id)
@@
-58,7
+67,7
@@
defmodule Pleroma.Web.PleromaAPI.MascotControllerTest do
|> assign(:user, user)
|> get("/api/v1/pleroma/mascot")
|> assign(:user, user)
|> get("/api/v1/pleroma/mascot")
- assert %{"url" => url, "type" => "image"} = json_response(conn, 200)
+ assert %{"url" => url, "type" => "image"} = json_response
_and_validate_schema
(conn, 200)
assert url =~ "an_image"
end
end
assert url =~ "an_image"
end
end