diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/support/factory.ex | 3 | ||||
-rw-r--r-- | test/web/common_api/common_api_test.exs | 13 | ||||
-rw-r--r-- | test/web/twitter_api/views/notification_view_test.exs | 2 | ||||
-rw-r--r-- | test/web/twitter_api/views/user_view_test.exs | 2 |
4 files changed, 17 insertions, 3 deletions
diff --git a/test/support/factory.ex b/test/support/factory.ex index 8e21e2562..b2e98c8d1 100644 --- a/test/support/factory.ex +++ b/test/support/factory.ex @@ -95,7 +95,8 @@ defmodule Pleroma.Factory do } %Pleroma.Activity{ - data: data + data: data, + actor: follower.ap_id } end diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs new file mode 100644 index 000000000..b597e6e0a --- /dev/null +++ b/test/web/common_api/common_api_test.exs @@ -0,0 +1,13 @@ +defmodule Pleroma.Web.CommonAPI.UtilsTest do + use Pleroma.DataCase + alias Pleroma.Web.CommonAPI + + import Pleroma.Factory + + test "it de-duplicates tags" do + user = insert(:user) + {:ok, activity} = CommonAPI.post(user, %{"status" => "#2hu #2HU"}) + + assert activity.data["object"]["tag"] == ["2hu"] + end +end diff --git a/test/web/twitter_api/views/notification_view_test.exs b/test/web/twitter_api/views/notification_view_test.exs index e3b140657..79eafda7d 100644 --- a/test/web/twitter_api/views/notification_view_test.exs +++ b/test/web/twitter_api/views/notification_view_test.exs @@ -24,7 +24,7 @@ defmodule Pleroma.Web.TwitterAPI.NotificationViewTest do {:ok, follower} = User.follow(follower, user) {:ok, activity} = ActivityPub.follow(follower, user) - Cachex.set(:user_cache, "user_info:#{user.id}", User.user_info(Repo.get!(User, user.id))) + Cachex.put(:user_cache, "user_info:#{user.id}", User.user_info(Repo.get!(User, user.id))) [follow_notif] = Notification.for_user(user) represented = %{ diff --git a/test/web/twitter_api/views/user_view_test.exs b/test/web/twitter_api/views/user_view_test.exs index dd55c0b7e..9f8bf4cdc 100644 --- a/test/web/twitter_api/views/user_view_test.exs +++ b/test/web/twitter_api/views/user_view_test.exs @@ -31,7 +31,7 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do User.follow(second_follower, user) User.follow(user, follower) {:ok, user} = User.update_follower_count(user) - Cachex.set(:user_cache, "user_info:#{user.id}", User.user_info(Repo.get!(User, user.id))) + Cachex.put(:user_cache, "user_info:#{user.id}", User.user_info(Repo.get!(User, user.id))) image = "http://localhost:4001/images/avi.png" banner = "http://localhost:4001/images/banner.png" |