fix(feed): format RSS build dates

This commit is contained in:
Lain Soykaf 2026-07-24 20:21:54 +04:00
commit 96f471a291
No known key found for this signature in database
3 changed files with 33 additions and 2 deletions

View file

@ -105,8 +105,10 @@ defmodule Pleroma.Web.Feed.TagControllerTest do
}
])
edited_at = NaiveDateTime.add(object.updated_at, 60)
object
|> Ecto.Changeset.change(data: object_data)
|> Ecto.Changeset.change(data: object_data, updated_at: edited_at)
|> Pleroma.Repo.update()
{:ok, activity2} = CommonAPI.post(user, %{status: "42 This is :moominmamma #PleromaArt"})
@ -141,6 +143,9 @@ defmodule Pleroma.Web.Feed.TagControllerTest do
FeedView.to_rfc2822(activity1.data["published"])
]
assert xpath(xml, ~x"//channel/lastBuildDate/text()"s) ==
FeedView.to_rfc2822(edited_at)
assert xpath(xml, ~x"//channel/item/media:content/@url"sl) == [
"https://peertube.moe/static/webseed/df5f464b-be8d-46fb-ad81-2d4c2d1630e3-480.mp4"
]
@ -181,6 +186,16 @@ defmodule Pleroma.Web.Feed.TagControllerTest do
]
end
test "does not fabricate lastBuildDate for an empty RSS feed", %{conn: conn} do
response =
conn
|> put_req_header("accept", "application/rss+xml")
|> get(tag_feed_path(conn, :feed, "empty.rss"))
|> response(200)
refute response =~ "<lastBuildDate>"
end
describe "private instance" do
setup do: clear_config([:instance, :public], false)