fix(feed): correct Atom entry links
This commit is contained in:
parent
d1a7e915ce
commit
ecd8a14435
4 changed files with 8 additions and 8 deletions
|
|
@ -15,8 +15,7 @@
|
||||||
<summary><%= escape(@data["summary"]) %></summary>
|
<summary><%= escape(@data["summary"]) %></summary>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<link type="application/atom+xml" href='<%= activity_link(@activity, @data) %>' rel="self"/>
|
<link type="text/html" href='<%= escape(activity_link(@activity, @data) || "") %>' rel="alternate"/>
|
||||||
<link type="text/html" href='<%= activity_link(@activity, @data) %>' rel="alternate"/>
|
|
||||||
|
|
||||||
<%= for tag <- Pleroma.Object.hashtags(@object) do %>
|
<%= for tag <- Pleroma.Object.hashtags(@object) do %>
|
||||||
<category term="<%= tag %>"></category>
|
<category term="<%= tag %>"></category>
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,7 @@
|
||||||
<summary><%= escape(@data["summary"]) %></summary>
|
<summary><%= escape(@data["summary"]) %></summary>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<link type="application/atom+xml" href='<%= activity_link(@activity, @data) %>' rel="self"/>
|
<link type="text/html" href='<%= escape(activity_link(@activity, @data) || "") %>' rel="alternate"/>
|
||||||
<link type="text/html" href='<%= activity_link(@activity, @data) %>' rel="alternate"/>
|
|
||||||
|
|
||||||
<%= for tag <- Pleroma.Object.hashtags(@object) do %>
|
<%= for tag <- Pleroma.Object.hashtags(@object) do %>
|
||||||
<category term="<%= tag %>"></category>
|
<category term="<%= tag %>"></category>
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,8 @@ defmodule Pleroma.Web.Feed.TagControllerTest do
|
||||||
]
|
]
|
||||||
|
|
||||||
assert xpath(xml, ~x"//feed/entry/author/name/text()"ls) == [user.nickname, user.nickname]
|
assert xpath(xml, ~x"//feed/entry/author/name/text()"ls) == [user.nickname, user.nickname]
|
||||||
|
assert xpath(xml, ~x"//feed/entry/link[@rel='self']/@href"sl) == []
|
||||||
|
assert length(xpath(xml, ~x"//feed/entry/link[@rel='alternate']/@href"sl)) == 2
|
||||||
|
|
||||||
assert xpath(xml, ~x"//feed/entry/link[@rel='enclosure']/@href"sl) == [
|
assert xpath(xml, ~x"//feed/entry/link[@rel='enclosure']/@href"sl) == [
|
||||||
"https://peertube.moe/video.mp4?first=one&second=two",
|
"https://peertube.moe/video.mp4?first=one&second=two",
|
||||||
|
|
|
||||||
|
|
@ -83,12 +83,12 @@ defmodule Pleroma.Web.Feed.UserControllerTest do
|
||||||
|> get(user_feed_path(conn, :feed, user.nickname))
|
|> get(user_feed_path(conn, :feed, user.nickname))
|
||||||
|> response(200)
|
|> response(200)
|
||||||
|
|
||||||
activity_titles =
|
xml = SweetXml.parse(resp)
|
||||||
resp
|
activity_titles = SweetXml.xpath(xml, ~x"//entry/title/text()"l)
|
||||||
|> SweetXml.parse()
|
|
||||||
|> SweetXml.xpath(~x"//entry/title/text()"l)
|
|
||||||
|
|
||||||
assert activity_titles == [~c"Won't, didn'...", ~c"2hu", ~c"2hu & as"]
|
assert activity_titles == [~c"Won't, didn'...", ~c"2hu", ~c"2hu & as"]
|
||||||
|
assert SweetXml.xpath(xml, ~x"//entry/link[@rel='self']/@href"sl) == []
|
||||||
|
assert length(SweetXml.xpath(xml, ~x"//entry/link[@rel='alternate']/@href"sl)) == 3
|
||||||
assert resp =~ FeedView.escape(object.data["content"])
|
assert resp =~ FeedView.escape(object.data["content"])
|
||||||
assert resp =~ FeedView.escape(object.data["summary"])
|
assert resp =~ FeedView.escape(object.data["summary"])
|
||||||
assert resp =~ FeedView.escape(object.data["context"])
|
assert resp =~ FeedView.escape(object.data["context"])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue