summaryrefslogtreecommitdiff
path: root/test/web/twitter_api/twitter_api_controller_test.exs
diff options
context:
space:
mode:
authorSachin Joshi <satchin.joshi@gmail.com>2019-07-15 21:30:56 +0545
committerSachin Joshi <satchin.joshi@gmail.com>2019-07-15 21:30:56 +0545
commit1d906ffa82633af21233c3030fbe2d127b5b77f9 (patch)
treef49175e422b68bee331d437c0dac76ccb5159ed3 /test/web/twitter_api/twitter_api_controller_test.exs
parentf8e3ae61545de45ce4dd395471149ed1e71e0343 (diff)
parent6aa5b39837b943a7a8fd5c6d1d617c74e933e088 (diff)
downloadpleroma-1d906ffa82633af21233c3030fbe2d127b5b77f9.tar.gz
pleroma-1d906ffa82633af21233c3030fbe2d127b5b77f9.zip
Merge branch 'develop' into match-file-name
# Conflicts: # lib/pleroma/web/media_proxy/media_proxy_controller.ex
Diffstat (limited to 'test/web/twitter_api/twitter_api_controller_test.exs')
-rw-r--r--test/web/twitter_api/twitter_api_controller_test.exs32
1 files changed, 32 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 7ec0e101d..de6177575 100644
--- a/test/web/twitter_api/twitter_api_controller_test.exs
+++ b/test/web/twitter_api/twitter_api_controller_test.exs
@@ -521,6 +521,38 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do
for: current_user
})
end
+
+ test "muted user", %{conn: conn, user: current_user} do
+ other_user = insert(:user)
+
+ {:ok, current_user} = User.mute(current_user, other_user)
+
+ {:ok, _activity} =
+ ActivityBuilder.insert(%{"to" => [current_user.ap_id]}, %{user: other_user})
+
+ conn =
+ conn
+ |> with_credentials(current_user.nickname, "test")
+ |> get("/api/qvitter/statuses/notifications.json")
+
+ assert json_response(conn, 200) == []
+ end
+
+ test "muted user with with_muted parameter", %{conn: conn, user: current_user} do
+ other_user = insert(:user)
+
+ {:ok, current_user} = User.mute(current_user, other_user)
+
+ {:ok, _activity} =
+ ActivityBuilder.insert(%{"to" => [current_user.ap_id]}, %{user: other_user})
+
+ conn =
+ conn
+ |> with_credentials(current_user.nickname, "test")
+ |> get("/api/qvitter/statuses/notifications.json", %{"with_muted" => "true"})
+
+ assert length(json_response(conn, 200)) == 1
+ end
end
describe "POST /api/qvitter/statuses/notifications/read" do