aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRoger Braun <roger@rogerbraun.net>2017-03-24 00:09:08 +0100
committerRoger Braun <roger@rogerbraun.net>2017-03-24 00:09:08 +0100
commit866a2663d4093204317aba7ff87a6d93eaf805fd (patch)
tree8a03b3eef18d4d79ec2d59ed76a9fe769f29d2bb /test
parentae50b165cced7fda1e62f677f959c6f202127aa7 (diff)
downloadpleroma-866a2663d4093204317aba7ff87a6d93eaf805fd.tar.gz
Add fetching of activities in context.
Diffstat (limited to 'test')
-rw-r--r--test/web/activity_pub/activity_pub_test.exs12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/web/activity_pub/activity_pub_test.exs b/test/web/activity_pub/activity_pub_test.exs
index 6a5138012..b773c323e 100644
--- a/test/web/activity_pub/activity_pub_test.exs
+++ b/test/web/activity_pub/activity_pub_test.exs
@@ -49,6 +49,18 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
end
end
+ describe "fetch activities in context" do
+ test "retrieves activities that have a given context" do
+ {:ok, activity} = ActivityBuilder.insert(%{"context" => "2hu"})
+ {:ok, activity_two} = ActivityBuilder.insert(%{"context" => "2hu"})
+ {:ok, _activity_three} = ActivityBuilder.insert(%{"context" => "3hu"})
+
+ activities = ActivityPub.fetch_activities_for_context("2hu")
+
+ assert activities == [activity, activity_two]
+ end
+ end
+
describe "public fetch activities" do
test "retrieves public activities" do
%{public: public} = ActivityBuilder.public_and_non_public