diff options
author | Maksim Pechnikov <parallel588@gmail.com> | 2020-05-06 15:08:38 +0300 |
---|---|---|
committer | Maksim Pechnikov <parallel588@gmail.com> | 2020-05-06 15:08:38 +0300 |
commit | bd261309cc27ebf5d2f78ea3c1474fe71ae8046d (patch) | |
tree | 40856a24fefe9286f8a287177fdf05e783030ad4 /test/web/mastodon_api/controllers/account_controller_test.exs | |
parent | 8b97b6f5baa7e0593414fa794ce8059a8e5b95e3 (diff) | |
download | pleroma-bd261309cc27ebf5d2f78ea3c1474fe71ae8046d.tar.gz pleroma-bd261309cc27ebf5d2f78ea3c1474fe71ae8046d.zip |
added `unread_notifications_count` for `/api/v1/accounts/verify_credentials`
Diffstat (limited to 'test/web/mastodon_api/controllers/account_controller_test.exs')
-rw-r--r-- | test/web/mastodon_api/controllers/account_controller_test.exs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/web/mastodon_api/controllers/account_controller_test.exs b/test/web/mastodon_api/controllers/account_controller_test.exs index b9da7e924..256a8b304 100644 --- a/test/web/mastodon_api/controllers/account_controller_test.exs +++ b/test/web/mastodon_api/controllers/account_controller_test.exs @@ -1196,12 +1196,15 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do describe "verify_credentials" do test "verify_credentials" do %{user: user, conn: conn} = oauth_access(["read:accounts"]) + [notification | _] = insert_list(7, :notification, user: user) + Pleroma.Notification.set_read_up_to(user, notification.id) conn = get(conn, "/api/v1/accounts/verify_credentials") response = json_response_and_validate_schema(conn, 200) assert %{"id" => id, "source" => %{"privacy" => "public"}} = response assert response["pleroma"]["chat_token"] + assert response["pleroma"]["unread_notifications_count"] == 6 assert id == to_string(user.id) end |