diff options
author | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2020-06-26 07:16:24 +0200 |
---|---|---|
committer | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2020-06-26 19:52:20 +0200 |
commit | 244655e884130df6dccabc0d2d78d33857809a36 (patch) | |
tree | 0e3d3d7310008259dae7db15130adc05e99030c2 /test/web/mastodon_api/controllers/status_controller_test.exs | |
parent | 27c33f216ad250b60d44fe0662c3be3c4cee987e (diff) | |
download | pleroma-244655e884130df6dccabc0d2d78d33857809a36.tar.gz pleroma-244655e884130df6dccabc0d2d78d33857809a36.zip |
MastoAPI: Show source field when deleting
Diffstat (limited to 'test/web/mastodon_api/controllers/status_controller_test.exs')
-rw-r--r-- | test/web/mastodon_api/controllers/status_controller_test.exs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/test/web/mastodon_api/controllers/status_controller_test.exs b/test/web/mastodon_api/controllers/status_controller_test.exs index a98e939e8..fd2de8d80 100644 --- a/test/web/mastodon_api/controllers/status_controller_test.exs +++ b/test/web/mastodon_api/controllers/status_controller_test.exs @@ -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 |