aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancis Dinh <normandy@firemail.cc>2018-03-27 02:07:07 -0400
committerFrancis Dinh <normandy@firemail.cc>2018-03-27 02:07:07 -0400
commit5ba2f4b6d8ba9f80a392b1298758f257d59cb853 (patch)
tree2a52bac5f7ee2cb1bd82369ed6b10ae740d8351e
parent61692c7efae4f8c6dc0e5b07276979f4237dee33 (diff)
downloadpleroma-5ba2f4b6d8ba9f80a392b1298758f257d59cb853.tar.gz
Update tests to reflect hashtag link changes
-rw-r--r--test/formatter_test.exs2
-rw-r--r--test/web/twitter_api/twitter_api_test.exs2
2 files changed, 2 insertions, 2 deletions
diff --git a/test/formatter_test.exs b/test/formatter_test.exs
index 0e915d8d5..9ec2cc9f2 100644
--- a/test/formatter_test.exs
+++ b/test/formatter_test.exs
@@ -7,7 +7,7 @@ defmodule Pleroma.FormatterTest do
describe ".add_hashtag_links" do
test "turns hashtags into links" do
text = "I love #cofe and #2hu"
- expected_text = "I love #<a href='http://localhost:4001/tag/cofe' rel='tag'>cofe</a> and #<a href='http://localhost:4001/tag/2hu' rel='tag'>2hu</a>"
+ expected_text = "I love <a href='http://localhost:4001/tag/cofe' rel='tag'>#cofe</a> and <a href='http://localhost:4001/tag/2hu' rel='tag'>#2hu</a>"
tags = Formatter.parse_tags(text)
assert expected_text == Formatter.add_hashtag_links({[], text}, tags) |> Formatter.finalize
diff --git a/test/web/twitter_api/twitter_api_test.exs b/test/web/twitter_api/twitter_api_test.exs
index 7d578a751..740371880 100644
--- a/test/web/twitter_api/twitter_api_test.exs
+++ b/test/web/twitter_api/twitter_api_test.exs
@@ -34,7 +34,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
{ :ok, activity = %Activity{} } = TwitterAPI.create_status(user, input)
- expected_text = "Hello again, <span><a href='shp'>@<span>shp</span></a></span>.&lt;script&gt;&lt;/script&gt;<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>"
+ expected_text = "Hello again, <span><a href='shp'>@<span>shp</span></a></span>.&lt;script&gt;&lt;/script&gt;<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