diff options
author | lain <lain@soykaf.club> | 2019-04-10 17:48:31 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2019-04-10 17:48:31 +0200 |
commit | c352a0aba601ae444bf5b479ab3c643728a8b35e (patch) | |
tree | 825af2db472a0a94c346a63e597c98bbb495c997 /test | |
parent | de57094fca505e7dbf1a84fef5fb31fae68f2709 (diff) | |
download | pleroma-c352a0aba601ae444bf5b479ab3c643728a8b35e.tar.gz pleroma-c352a0aba601ae444bf5b479ab3c643728a8b35e.zip |
Conversations: Make tests run.
Diffstat (limited to 'test')
-rw-r--r-- | test/web/mastodon_api/mastodon_api_controller_test.exs | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs index 519ad8f4d..d1d22edde 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -325,14 +325,17 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do assert response = json_response(res_conn, 200) - assert %{ - "id" => res_id, - "accounts" => res_accounts, - "last_status" => res_last_status, - "unread" => unread - } = response + assert [ + %{ + "id" => res_id, + "accounts" => res_accounts, + "last_status" => res_last_status, + "unread" => unread + } + ] = response - assert unread == false + assert unread == true + assert res_last_status == direct.id # Apparently undocumented API endpoint res_conn = @@ -340,15 +343,16 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do |> assign(:user, user_one) |> post("/api/v1/conversations/#{res_id}/read") - assert response == json_response(res_conn, 200) + assert response = json_response(res_conn, 200) + assert response["unread"] == false # (vanilla) Mastodon frontend behaviour res_conn = conn |> assign(:user, user_one) - |> get("/api/v1/statuses/#{res_last_status.id}/context") + |> get("/api/v1/statuses/#{res_last_status}/context") - assert %{ancestors: [], descendants: []} == json_response(res_conn, 200) + assert %{"ancestors" => [], "descendants" => []} == json_response(res_conn, 200) end test "doesn't include DMs from blocked users", %{conn: conn} do |