aboutsummaryrefslogtreecommitdiff
path: root/test/pleroma/activity
diff options
context:
space:
mode:
authorAlex Gleason <alex@alexgleason.me>2021-05-28 13:38:44 -0500
committerAlex Gleason <alex@alexgleason.me>2021-05-28 13:38:44 -0500
commit05b47aacd25a86ba6dfcdd6577c6c558229c8e95 (patch)
treee4ecd6498fc64a78bf8d92c2ca6e8f8edc0fbcfe /test/pleroma/activity
parent9b0b0842ce2b0b9a870f57e16025160855aa4c11 (diff)
parent7ad87571bdcd39959280d15f5bfe4175e04c442c (diff)
downloadpleroma-endpoint-url.tar.gz
Merge remote-tracking branch 'pleroma/develop' into endpoint-urlendpoint-url
Diffstat (limited to 'test/pleroma/activity')
-rw-r--r--test/pleroma/activity/ir/topics_test.exs15
1 files changed, 8 insertions, 7 deletions
diff --git a/test/pleroma/activity/ir/topics_test.exs b/test/pleroma/activity/ir/topics_test.exs
index 6b848e04d..9c8e5d932 100644
--- a/test/pleroma/activity/ir/topics_test.exs
+++ b/test/pleroma/activity/ir/topics_test.exs
@@ -11,6 +11,8 @@ defmodule Pleroma.Activity.Ir.TopicsTest do
require Pleroma.Constants
+ import Mock
+
describe "poll answer" do
test "produce no topics" do
activity = %Activity{object: %Object{data: %{"type" => "Answer"}}}
@@ -77,14 +79,13 @@ defmodule Pleroma.Activity.Ir.TopicsTest do
refute Enum.member?(topics, "public:local:media")
end
- test "converts tags to hash tags", %{activity: %{object: %{data: data} = object} = activity} do
- tagged_data = Map.put(data, "tag", ["foo", "bar"])
- activity = %{activity | object: %{object | data: tagged_data}}
-
- topics = Topics.get_activity_topics(activity)
+ test "converts tags to hash tags", %{activity: activity} do
+ with_mock(Object, [:passthrough], hashtags: fn _ -> ["foo", "bar"] end) do
+ topics = Topics.get_activity_topics(activity)
- assert Enum.member?(topics, "hashtag:foo")
- assert Enum.member?(topics, "hashtag:bar")
+ assert Enum.member?(topics, "hashtag:foo")
+ assert Enum.member?(topics, "hashtag:bar")
+ end
end
test "only converts strings to hash tags", %{