MastoAPI: Show source field when deleting
This commit is contained in:
parent
27c33f216a
commit
244655e884
7 changed files with 28 additions and 8 deletions
|
|
@ -760,13 +760,18 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|
|||
test "when you created it" do
|
||||
%{user: author, conn: conn} = oauth_access(["write:statuses"])
|
||||
activity = insert(:note_activity, user: author)
|
||||
object = Object.normalize(activity)
|
||||
|
||||
conn =
|
||||
content = object.data["content"]
|
||||
source = object.data["source"]
|
||||
|
||||
result =
|
||||
conn
|
||||
|> assign(:user, author)
|
||||
|> delete("/api/v1/statuses/#{activity.id}")
|
||||
|> json_response_and_validate_schema(200)
|
||||
|
||||
assert %{} = json_response_and_validate_schema(conn, 200)
|
||||
assert match?(%{"content" => ^content, "text" => ^source}, result)
|
||||
|
||||
refute Activity.get_by_id(activity.id)
|
||||
end
|
||||
|
|
@ -789,7 +794,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|
|||
|
||||
conn = delete(conn, "/api/v1/statuses/#{activity.id}")
|
||||
|
||||
assert %{"error" => _} = json_response_and_validate_schema(conn, 403)
|
||||
assert %{"error" => "Record not found"} == json_response_and_validate_schema(conn, 404)
|
||||
|
||||
assert Activity.get_by_id(activity.id) == activity
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue