aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2018-12-17 21:19:00 +0100
committerlain <lain@soykaf.club>2018-12-17 21:19:00 +0100
commiteb2d34eb6cc3257a260994b7b144a80dd254602c (patch)
tree374acdbd774e443b71d1f8b97a9bdd0f2b428d1d /test
parent3e1816fcd5b5b109ba51c5a4f021a1851893c131 (diff)
parent3d980daa49e51c7e3ec1f019e2b68c8108b37c76 (diff)
downloadpleroma-eb2d34eb6cc3257a260994b7b144a80dd254602c.tar.gz
Merge remote-tracking branch 'origin/develop' into 2018-12-17-update-frontend
Diffstat (limited to 'test')
-rw-r--r--test/web/twitter_api/views/activity_view_test.exs16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/web/twitter_api/views/activity_view_test.exs b/test/web/twitter_api/views/activity_view_test.exs
index 77b8d99e7..8aa9e3130 100644
--- a/test/web/twitter_api/views/activity_view_test.exs
+++ b/test/web/twitter_api/views/activity_view_test.exs
@@ -14,6 +14,22 @@ defmodule Pleroma.Web.TwitterAPI.ActivityViewTest do
import Pleroma.Factory
import Mock
+ test "a create activity with a html status" do
+ text = """
+ #Bike log - Commute Tuesday\nhttps://pla.bike/posts/20181211/\n#cycling #CHScycling #commute\nMVIMG_20181211_054020.jpg
+ """
+
+ {:ok, activity} = CommonAPI.post(insert(:user), %{"status" => text})
+
+ result = ActivityView.render("activity.json", activity: activity)
+
+ assert result["statusnet_html"] ==
+ "<a data-tag=\"bike\" href=\"http://localhost:4001/tag/bike\">#Bike</a> log - Commute Tuesday<br /><a href=\"https://pla.bike/posts/20181211/\">https://pla.bike/posts/20181211/</a><br /><a data-tag=\"cycling\" href=\"http://localhost:4001/tag/cycling\">#cycling</a> <a data-tag=\"chscycling\" href=\"http://localhost:4001/tag/chscycling\">#CHScycling</a> <a data-tag=\"commute\" href=\"http://localhost:4001/tag/commute\">#commute</a><br />MVIMG_20181211_054020.jpg"
+
+ assert result["text"] ==
+ "#Bike log - Commute Tuesday\nhttps://pla.bike/posts/20181211/\n#cycling #CHScycling #commute\nMVIMG_20181211_054020.jpg"
+ end
+
test "a create activity with a note" do
user = insert(:user)
other_user = insert(:user, %{nickname: "shp"})