modify user feed controller test to expect summary for title

This commit is contained in:
faried nawaz 2022-11-15 23:45:08 +05:00
parent 0f67eab384
commit c49316faee
No known key found for this signature in database
GPG key ID: C8EBC3669D3539B4

View file

@ -74,7 +74,7 @@ defmodule Pleroma.Web.Feed.UserControllerTest do
|> SweetXml.parse() |> SweetXml.parse()
|> SweetXml.xpath(~x"//entry/title/text()"l) |> SweetXml.xpath(~x"//entry/title/text()"l)
assert activity_titles == ['42 & Thi...', 'This & t...'] assert activity_titles == ['2hu', '2hu & as']
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"])
@ -90,7 +90,7 @@ defmodule Pleroma.Web.Feed.UserControllerTest do
|> SweetXml.parse() |> SweetXml.parse()
|> SweetXml.xpath(~x"//entry/title/text()"l) |> SweetXml.xpath(~x"//entry/title/text()"l)
assert activity_titles == ['This & t...'] assert activity_titles == ['2hu & as']
end end
test "gets a rss feed", %{conn: conn, user: user, object: object, max_id: max_id} do test "gets a rss feed", %{conn: conn, user: user, object: object, max_id: max_id} do
@ -105,7 +105,7 @@ defmodule Pleroma.Web.Feed.UserControllerTest do
|> SweetXml.parse() |> SweetXml.parse()
|> SweetXml.xpath(~x"//item/title/text()"l) |> SweetXml.xpath(~x"//item/title/text()"l)
assert activity_titles == ['42 & Thi...', 'This & t...'] assert activity_titles == ['2hu', '2hu & as']
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"])
@ -121,7 +121,7 @@ defmodule Pleroma.Web.Feed.UserControllerTest do
|> SweetXml.parse() |> SweetXml.parse()
|> SweetXml.xpath(~x"//item/title/text()"l) |> SweetXml.xpath(~x"//item/title/text()"l)
assert activity_titles == ['This & t...'] assert activity_titles == ['2hu & as']
end end
test "returns 404 for a missing feed", %{conn: conn} do test "returns 404 for a missing feed", %{conn: conn} do