Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into remake-remodel-dms
This commit is contained in:
commit
ee35bb5ac2
64 changed files with 1593 additions and 701 deletions
|
|
@ -33,6 +33,13 @@ defmodule Pleroma.Web.PleromaAPI.EmojiReactionControllerTest do
|
|||
assert result["pleroma"]["emoji_reactions"] == [
|
||||
%{"name" => "☕", "count" => 1, "me" => true}
|
||||
]
|
||||
|
||||
# Reacting with a non-emoji
|
||||
assert conn
|
||||
|> assign(:user, other_user)
|
||||
|> assign(:token, insert(:oauth_token, user: other_user, scopes: ["write:statuses"]))
|
||||
|> put("/api/v1/pleroma/statuses/#{activity.id}/reactions/x")
|
||||
|> json_response_and_validate_schema(400)
|
||||
end
|
||||
|
||||
test "DELETE /api/v1/pleroma/statuses/:id/reactions/:emoji", %{conn: conn} do
|
||||
|
|
|
|||
|
|
@ -23,7 +23,8 @@ defmodule Pleroma.Web.PleromaAPI.NotificationControllerTest do
|
|||
|
||||
response =
|
||||
conn
|
||||
|> post("/api/v1/pleroma/notifications/read?id=#{notification1.id}")
|
||||
|> put_req_header("content-type", "application/json")
|
||||
|> post("/api/v1/pleroma/notifications/read", %{id: notification1.id})
|
||||
|> json_response_and_validate_schema(:ok)
|
||||
|
||||
assert %{"pleroma" => %{"is_seen" => true}} = response
|
||||
|
|
@ -41,7 +42,8 @@ defmodule Pleroma.Web.PleromaAPI.NotificationControllerTest do
|
|||
|
||||
[response1, response2] =
|
||||
conn
|
||||
|> post("/api/v1/pleroma/notifications/read?max_id=#{notification2.id}")
|
||||
|> put_req_header("content-type", "application/json")
|
||||
|> post("/api/v1/pleroma/notifications/read", %{max_id: notification2.id})
|
||||
|> json_response_and_validate_schema(:ok)
|
||||
|
||||
assert %{"pleroma" => %{"is_seen" => true}} = response1
|
||||
|
|
@ -54,7 +56,10 @@ defmodule Pleroma.Web.PleromaAPI.NotificationControllerTest do
|
|||
test "it returns error when notification not found", %{conn: conn} do
|
||||
response =
|
||||
conn
|
||||
|> post("/api/v1/pleroma/notifications/read?id=22222222222222")
|
||||
|> put_req_header("content-type", "application/json")
|
||||
|> post("/api/v1/pleroma/notifications/read", %{
|
||||
id: 22_222_222_222_222
|
||||
})
|
||||
|> json_response_and_validate_schema(:bad_request)
|
||||
|
||||
assert response == %{"error" => "Cannot get notification"}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue