summaryrefslogtreecommitdiff
path: root/test/web/common_api/common_api_test.exs
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2019-11-04 14:11:44 +0000
committerlain <lain@soykaf.club>2019-11-04 14:11:44 +0000
commit556da9290217823ac8a6f4cecfda2186a4d6985d (patch)
treef837914d84e7ae41c3de76ba9f5d50f40494f794 /test/web/common_api/common_api_test.exs
parentbab786cd935e37a74483d090fdfbb283764d83fe (diff)
parentd56bc622755ea0a858bf086bc1f525c1752e4db8 (diff)
downloadpleroma-556da9290217823ac8a6f4cecfda2186a4d6985d.tar.gz
pleroma-556da9290217823ac8a6f4cecfda2186a4d6985d.zip
Merge branch 'feature/store-statuses-data-inside-flag' into 'develop'
Store status data inside flag activity See merge request pleroma/pleroma!1849
Diffstat (limited to 'test/web/common_api/common_api_test.exs')
-rw-r--r--test/web/common_api/common_api_test.exs16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs
index 212b00cbb..8e6fbd7f0 100644
--- a/test/web/common_api/common_api_test.exs
+++ b/test/web/common_api/common_api_test.exs
@@ -10,6 +10,7 @@ defmodule Pleroma.Web.CommonAPITest do
alias Pleroma.User
alias Pleroma.Web.ActivityPub.ActivityPub
alias Pleroma.Web.ActivityPub.Visibility
+ alias Pleroma.Web.AdminAPI.AccountView
alias Pleroma.Web.CommonAPI
import Pleroma.Factory
@@ -385,6 +386,14 @@ defmodule Pleroma.Web.CommonAPITest do
"status_ids" => [activity.id]
}
+ note_obj = %{
+ "type" => "Note",
+ "id" => activity_ap_id,
+ "content" => "foobar",
+ "published" => activity.object.data["published"],
+ "actor" => AccountView.render("show.json", %{user: target_user})
+ }
+
assert {:ok, flag_activity} = CommonAPI.report(reporter, report_data)
assert %Activity{
@@ -392,7 +401,7 @@ defmodule Pleroma.Web.CommonAPITest do
data: %{
"type" => "Flag",
"content" => ^comment,
- "object" => [^target_ap_id, ^activity_ap_id],
+ "object" => [^target_ap_id, ^note_obj],
"state" => "open"
}
} = flag_activity
@@ -412,6 +421,11 @@ defmodule Pleroma.Web.CommonAPITest do
{:ok, report} = CommonAPI.update_report_state(report_id, "resolved")
assert report.data["state"] == "resolved"
+
+ [reported_user, activity_id] = report.data["object"]
+
+ assert reported_user == target_user.ap_id
+ assert activity_id == activity.data["id"]
end
test "does not update report state when state is unsupported" do