mastodon api tests: invalidate user cache prior to importing a test reply

This is needed to ensure the user cache does not throw nil when creating the mentions
list.

Signed-off-by: lain <lain@soykaf.club>
This commit is contained in:
William Pitcock 2018-03-16 05:30:28 +00:00 committed by lain
parent 000b3f1837
commit 0ee6e8af26

View file

@ -60,6 +60,9 @@ test "contains mentions" do
recipient = "https://pleroma.soykaf.com/users/lain" recipient = "https://pleroma.soykaf.com/users/lain"
user = User.get_cached_by_ap_id(recipient) || insert(:user, %{ap_id: recipient}) user = User.get_cached_by_ap_id(recipient) || insert(:user, %{ap_id: recipient})
# invalidate the cache
User.invalidate_cache(user)
{:ok, [activity]} = OStatus.handle_incoming(incoming) {:ok, [activity]} = OStatus.handle_incoming(incoming)
status = StatusView.render("status.json", %{activity: activity}) status = StatusView.render("status.json", %{activity: activity})