aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRoger Braun <roger@rogerbraun.net>2017-07-02 15:01:59 +0200
committerRoger Braun <roger@rogerbraun.net>2017-07-02 15:01:59 +0200
commite343c0c9c42968316c93ebb52a570ccd5778acb0 (patch)
treec8e2f4213a46913f0ca3cd54bd25056bd9506d67 /test
parent5d8352a4296dc06fd548f3e53db3f1f38040cfd0 (diff)
downloadpleroma-e343c0c9c42968316c93ebb52a570ccd5778acb0.tar.gz
Add way to update most recent notification id.
Diffstat (limited to 'test')
-rw-r--r--test/web/twitter_api/twitter_api_controller_test.exs18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/web/twitter_api/twitter_api_controller_test.exs b/test/web/twitter_api/twitter_api_controller_test.exs
index 4450bd5e5..0281ea55b 100644
--- a/test/web/twitter_api/twitter_api_controller_test.exs
+++ b/test/web/twitter_api/twitter_api_controller_test.exs
@@ -24,6 +24,24 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do
end
end
+ describe "POST /api/account/most_recent_notification" do
+ setup [:valid_user]
+ test "without valid credentials", %{conn: conn} do
+ conn = post conn, "/api/account/most_recent_notification.json"
+ assert json_response(conn, 403) == %{"error" => "Invalid credentials."}
+ end
+
+ test "with credentials", %{conn: conn, user: user} do
+ conn = conn
+ |> with_credentials(user.nickname, "test")
+ |> post("/api/account/most_recent_notification.json", %{id: "200"})
+
+ assert json_response(conn, 200)
+ user = User.get_by_nickname(user.nickname)
+ assert user.info["most_recent_notification"] == 200
+ end
+ end
+
describe "POST /statuses/update.json" do
setup [:valid_user]
test "without valid credentials", %{conn: conn} do