projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 's3-namespace' into 'develop'
[akkoma]
/
test
/
web
/
twitter_api
/
views
/
activity_view_test.exs
diff --git
a/test/web/twitter_api/views/activity_view_test.exs
b/test/web/twitter_api/views/activity_view_test.exs
index bd4878e988180431904e73c04222d4dc10aa45db..ba053d20d04d276c7904ffc4fdfc573c503e509c 100644
(file)
--- a/
test/web/twitter_api/views/activity_view_test.exs
+++ b/
test/web/twitter_api/views/activity_view_test.exs
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-201
8
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-201
9
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.TwitterAPI.ActivityViewTest do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.TwitterAPI.ActivityViewTest do
@@
-66,7
+66,7
@@
defmodule Pleroma.Web.TwitterAPI.ActivityViewTest do
result = ActivityView.render("activity.json", activity: activity)
assert result["statusnet_html"] ==
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"
+ "<a
class=\"hashtag\" 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 class=\"hashtag\" data-tag=\"cycling\" href=\"http://localhost:4001/tag/cycling\">#cycling</a> <a class=\"hashtag\" data-tag=\"chscycling\" href=\"http://localhost:4001/tag/chscycling\">#CHScycling</a> <a class=\"hashtag\"
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"
assert result["text"] ==
"#Bike log - Commute Tuesday\nhttps://pla.bike/posts/20181211/\n#cycling #CHScycling #commute\nMVIMG_20181211_054020.jpg"
@@
-81,10
+81,13
@@
defmodule Pleroma.Web.TwitterAPI.ActivityViewTest do
result = ActivityView.render("activity.json", activity: activity)
result = ActivityView.render("activity.json", activity: activity)
- expected =
+ expected = ":woollysocks: meow"
+
+ expected_html =
"<img height=\"32px\" width=\"32px\" alt=\"woollysocks\" title=\"woollysocks\" src=\"http://localhost:4001/finmoji/128px/woollysocks-128.png\" /> meow"
assert result["summary"] == expected
"<img height=\"32px\" width=\"32px\" alt=\"woollysocks\" title=\"woollysocks\" src=\"http://localhost:4001/finmoji/128px/woollysocks-128.png\" /> meow"
assert result["summary"] == expected
+ assert result["summary_html"] == expected_html
end
test "a create activity with a summary containing invalid HTML" do
end
test "a create activity with a summary containing invalid HTML" do
@@
-99,6
+102,7
@@
defmodule Pleroma.Web.TwitterAPI.ActivityViewTest do
expected = "meow"
assert result["summary"] == expected
expected = "meow"
assert result["summary"] == expected
+ assert result["summary_html"] == expected
end
test "a create activity with a note" do
end
test "a create activity with a note" do
@@
-132,10
+136,14
@@
defmodule Pleroma.Web.TwitterAPI.ActivityViewTest do
"possibly_sensitive" => false,
"repeat_num" => 0,
"repeated" => false,
"possibly_sensitive" => false,
"repeat_num" => 0,
"repeated" => false,
+ "pinned" => false,
"statusnet_conversation_id" => convo_id,
"summary" => "",
"statusnet_conversation_id" => convo_id,
"summary" => "",
+ "summary_html" => "",
"statusnet_html" =>
"statusnet_html" =>
- "Hey <span><a data-user=\"#{other_user.id}\" href=\"#{other_user.ap_id}\">@<span>shp</span></a></span>!",
+ "Hey <span class=\"h-card\"><a data-user=\"#{other_user.id}\" class=\"u-url mention\" href=\"#{
+ other_user.ap_id
+ }\">@<span>shp</span></a></span>!",
"tags" => [],
"text" => "Hey @shp!",
"uri" => activity.data["object"]["id"],
"tags" => [],
"text" => "Hey @shp!",
"uri" => activity.data["object"]["id"],
@@
-336,7
+344,7
@@
defmodule Pleroma.Web.TwitterAPI.ActivityViewTest do
"https://peertube.moe/videos/watch/df5f464b-be8d-46fb-ad81-2d4c2d1630e3"
)
"https://peertube.moe/videos/watch/df5f464b-be8d-46fb-ad81-2d4c2d1630e3"
)
- %Activity{} = activity = Activity.get_create_
activity_
by_object_ap_id(object.data["id"])
+ %Activity{} = activity = Activity.get_create_by_object_ap_id(object.data["id"])
result = ActivityView.render("activity.json", activity: activity)
result = ActivityView.render("activity.json", activity: activity)