summaryrefslogtreecommitdiff
path: root/test/web/activity_pub
diff options
context:
space:
mode:
authorkaniini <nenolod@gmail.com>2019-01-27 12:45:50 +0000
committerkaniini <nenolod@gmail.com>2019-01-27 12:45:50 +0000
commit5eb81d2c72c593d5b7dfb893827c0685467c21ca (patch)
tree46fd8c65465726ee497e2276db91c47d1e8fd22c /test/web/activity_pub
parentb58e4ddb10a1144a0afbac259cbe8bfcfd363ba6 (diff)
parentde956b9e04f9c3706d50522bf19a0fb6477feecc (diff)
downloadpleroma-5eb81d2c72c593d5b7dfb893827c0685467c21ca.tar.gz
pleroma-5eb81d2c72c593d5b7dfb893827c0685467c21ca.zip
Merge branch 'features/mastoapi-multi-hashtag' into 'develop'
MastodonAPI multi-hashtag See merge request pleroma/pleroma!652
Diffstat (limited to 'test/web/activity_pub')
-rw-r--r--test/web/activity_pub/activity_pub_test.exs28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/web/activity_pub/activity_pub_test.exs b/test/web/activity_pub/activity_pub_test.exs
index 91548ab5f..7895cf21d 100644
--- a/test/web/activity_pub/activity_pub_test.exs
+++ b/test/web/activity_pub/activity_pub_test.exs
@@ -64,6 +64,34 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
assert user.info.ap_enabled
assert user.follower_address == "http://mastodon.example.org/users/admin/followers"
end
+
+ test "it fetches the appropriate tag-restricted posts" do
+ user = insert(:user)
+
+ {:ok, status_one} = CommonAPI.post(user, %{"status" => ". #test"})
+ {:ok, status_two} = CommonAPI.post(user, %{"status" => ". #essais"})
+ {:ok, status_three} = CommonAPI.post(user, %{"status" => ". #test #reject"})
+
+ fetch_one = ActivityPub.fetch_activities([], %{"tag" => "test"})
+ fetch_two = ActivityPub.fetch_activities([], %{"tag" => ["test", "essais"]})
+
+ fetch_three =
+ ActivityPub.fetch_activities([], %{
+ "tag" => ["test", "essais"],
+ "tag_reject" => ["reject"]
+ })
+
+ fetch_four =
+ ActivityPub.fetch_activities([], %{
+ "tag" => ["test"],
+ "tag_all" => ["test", "reject"]
+ })
+
+ assert fetch_one == [status_one, status_three]
+ assert fetch_two == [status_one, status_two, status_three]
+ assert fetch_three == [status_one, status_two]
+ assert fetch_four == [status_three]
+ end
end
describe "insertion" do