summaryrefslogtreecommitdiff
path: root/test/pleroma/activity/ir/topics_test.exs
diff options
context:
space:
mode:
authorHaelwenn <contact+git.pleroma.social@hacktivis.me>2021-08-08 14:37:15 +0000
committerHaelwenn <contact+git.pleroma.social@hacktivis.me>2021-08-08 14:37:15 +0000
commitdc63aaf84f07a6f8042f43617d8ec356fed85cec (patch)
tree5d12a05bce5dc1a23736fd37e7ca8c64580acd34 /test/pleroma/activity/ir/topics_test.exs
parentb221d77a6da07c684bdbc63ddf4500e0d7ffeae8 (diff)
parent0910777d41f8b4b3096c35c5fc97fc357e5d8c8c (diff)
Merge branch 'release/2.4.0' into 'stable'v2.4.0
Release/2.4.0 See merge request pleroma/pleroma!3493
Diffstat (limited to 'test/pleroma/activity/ir/topics_test.exs')
-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", %{