summaryrefslogtreecommitdiff
path: root/test/web/mastodon_api/controllers/account_controller_test.exs
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-05-08 09:23:01 +0000
committerlain <lain@soykaf.club>2020-05-08 09:23:01 +0000
commit0cf43391f272b2bb756b564e12bbcd3efda6a4bd (patch)
tree3ce1732a3a997de5070e005f9b4102a5c01c878c /test/web/mastodon_api/controllers/account_controller_test.exs
parent218a22c9a36ff2f8de353110f0badfc1ec5aa0f2 (diff)
parenta081135365c2b9d7bc81ee84baffbc3c2be68e8c (diff)
downloadpleroma-0cf43391f272b2bb756b564e12bbcd3efda6a4bd.tar.gz
pleroma-0cf43391f272b2bb756b564e12bbcd3efda6a4bd.zip
Merge branch 'issue/1276-2' into 'develop'
[#1276] added an endpoint for getting unread notification count See merge request pleroma/pleroma!2392
Diffstat (limited to 'test/web/mastodon_api/controllers/account_controller_test.exs')
-rw-r--r--test/web/mastodon_api/controllers/account_controller_test.exs3
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