diff options
| author | lambda <pleromagit@rogerbraun.net> | 2018-12-17 20:11:46 +0000 | 
|---|---|---|
| committer | lambda <pleromagit@rogerbraun.net> | 2018-12-17 20:11:46 +0000 | 
| commit | ebbe11f33b62cb248170ba25e5c9cd2e5b339b3a (patch) | |
| tree | aa0d7fe1c96e037046565d2bfa3d48cefe138de8 /test/web/twitter_api | |
| parent | 52ac7dce5c460d27d946d26070eb123e89af2914 (diff) | |
| parent | 92a5133c42f62685007877eeaa26e4d61230d995 (diff) | |
| download | pleroma-ebbe11f33b62cb248170ba25e5c9cd2e5b339b3a.tar.gz pleroma-ebbe11f33b62cb248170ba25e5c9cd2e5b339b3a.zip | |
Merge branch 'support/issue_449' into 'develop'
[#449] fix text field
See merge request pleroma/pleroma!563
Diffstat (limited to 'test/web/twitter_api')
| -rw-r--r-- | test/web/twitter_api/views/activity_view_test.exs | 16 | 
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"}) | 
