aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2019-08-12 13:58:04 +0200
committerlain <lain@soykaf.club>2019-08-12 13:58:04 +0200
commit60231ec7bd0af993dc19f69a57b261b3b4167636 (patch)
treeaba2ee915d8c87bae5b52d4abf80d1b14f8a0d49 /test
parent23c46f7e72701b773d87b825526450e5f4ec6322 (diff)
downloadpleroma-60231ec7bd0af993dc19f69a57b261b3b4167636.tar.gz
Conversation: Add endpoint to get a conversation by id.
Diffstat (limited to 'test')
-rw-r--r--test/web/pleroma_api/pleroma_api_controller_test.exs18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/web/pleroma_api/pleroma_api_controller_test.exs b/test/web/pleroma_api/pleroma_api_controller_test.exs
index 56bc1572c..ed6b79727 100644
--- a/test/web/pleroma_api/pleroma_api_controller_test.exs
+++ b/test/web/pleroma_api/pleroma_api_controller_test.exs
@@ -11,6 +11,24 @@ defmodule Pleroma.Web.PleromaAPI.PleromaAPIControllerTest do
import Pleroma.Factory
+ test "/api/v1/pleroma/conversations/:id", %{conn: conn} do
+ user = insert(:user)
+ other_user = insert(:user)
+
+ {:ok, _activity} =
+ CommonAPI.post(user, %{"status" => "Hi @#{other_user.nickname}!", "visibility" => "direct"})
+
+ [participation] = Participation.for_user(other_user)
+
+ result =
+ conn
+ |> assign(:user, other_user)
+ |> get("/api/v1/pleroma/conversations/#{participation.id}")
+ |> json_response(200)
+
+ assert result["id"] == participation.id |> to_string()
+ end
+
test "/api/v1/pleroma/conversations/:id/statuses", %{conn: conn} do
user = insert(:user)
other_user = insert(:user)