diff options
author | lain <lain@soykaf.club> | 2020-07-06 12:07:56 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-07-06 12:07:56 +0200 |
commit | ed4f9f6a29d8cf2dd31e41bae7e63aaa15bc9548 (patch) | |
tree | 82c5e8b4a40495485533b9c95668cef39ce909d2 /test/web/mastodon_api/controllers/status_controller_test.exs | |
parent | a5bbfa21a1fabe97bfff1cc80348d2944319f3ad (diff) | |
parent | 69f0b286f7b3e0518ac7ae54dfb06539dc179698 (diff) | |
download | pleroma-ed4f9f6a29d8cf2dd31e41bae7e63aaa15bc9548.tar.gz pleroma-ed4f9f6a29d8cf2dd31e41bae7e63aaa15bc9548.zip |
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into 1507-static-fe-prioritize-json
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 |