diff options
author | lain <lain@soykaf.club> | 2018-03-24 11:03:10 +0100 |
---|---|---|
committer | lain <lain@soykaf.club> | 2018-03-24 11:03:10 +0100 |
commit | eb7ce61ca511ac7066fbaa5795f30f48135ac224 (patch) | |
tree | 1488c85332da1d7001b483df95ec2f97954c1de4 /test/web/twitter_api/twitter_api_test.exs | |
parent | fbe9aa3506807b5c0f30ea8e877193a0b5ae91a6 (diff) | |
download | pleroma-eb7ce61ca511ac7066fbaa5795f30f48135ac224.tar.gz |
Fix hashtags.
Diffstat (limited to 'test/web/twitter_api/twitter_api_test.exs')
-rw-r--r-- | test/web/twitter_api/twitter_api_test.exs | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/test/web/twitter_api/twitter_api_test.exs b/test/web/twitter_api/twitter_api_test.exs index 6b0b182a3..7d578a751 100644 --- a/test/web/twitter_api/twitter_api_test.exs +++ b/test/web/twitter_api/twitter_api_test.exs @@ -34,7 +34,8 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do { :ok, activity = %Activity{} } = TwitterAPI.create_status(user, input) - assert get_in(activity.data, ["object", "content"]) == "Hello again, <span><a href='shp'>@<span>shp</span></a></span>.<script></script><br>This is on another :moominmamma: line. #2hu #epic #phantasmagoric<br><a href=\"http://example.org/image.jpg\" class='attachment'>image.jpg</a>" + expected_text = "Hello again, <span><a href='shp'>@<span>shp</span></a></span>.<script></script><br>This is on another :moominmamma: line. #<a href='http://localhost:4001/tag/2hu' rel='tag'>2hu</a> #<a href='http://localhost:4001/tag/epic' rel='tag'>epic</a> #<a href='http://localhost:4001/tag/phantasmagoric' rel='tag'>phantasmagoric</a><br><a href=\"http://example.org/image.jpg\" class='attachment'>image.jpg</a>" + assert get_in(activity.data, ["object", "content"]) == expected_text assert get_in(activity.data, ["object", "type"]) == "Note" assert get_in(activity.data, ["object", "actor"]) == user.ap_id assert get_in(activity.data, ["actor"]) == user.ap_id @@ -282,19 +283,6 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do assert is_binary(response) end - test "it adds user links to an existing text" do - text = "@gsimg According to @archaeme, that is @daggsy. Also hello @archaeme@archae.me" - - gsimg = insert(:user, %{nickname: "gsimg"}) - archaeme = insert(:user, %{nickname: "archaeme"}) - archaeme_remote = insert(:user, %{nickname: "archaeme@archae.me"}) - - mentions = Pleroma.Formatter.parse_mentions(text) - expected_text = "<span><a href='#{gsimg.ap_id}'>@<span>gsimg</span></a></span> According to <span><a href='#{archaeme.ap_id}'>@<span>archaeme</span></a></span>, that is @daggsy. Also hello <span><a href='#{archaeme_remote.ap_id}'>@<span>archaeme</span></a></span>" - - assert Utils.add_user_links(text, mentions) == expected_text - end - test "it favorites a status, returns the updated status" do user = insert(:user) note_activity = insert(:note_activity) |