alias Pleroma.Web.CommonAPI
alias Pleroma.Web.Feed.FeedView
- clear_config([:feed])
+ setup do: clear_config([:feed])
test "gets a feed (ATOM)", %{conn: conn} do
Pleroma.Config.put(
)
user = insert(:user)
- {:ok, activity1} = CommonAPI.post(user, %{"status" => "yeah #PleromaArt"})
+ {:ok, activity1} = CommonAPI.post(user, %{status: "yeah #PleromaArt"})
object = Object.normalize(activity1)
|> Ecto.Changeset.change(data: object_data)
|> Pleroma.Repo.update()
- {:ok, activity2} = CommonAPI.post(user, %{"status" => "42 This is :moominmamma #PleromaArt"})
+ {:ok, activity2} = CommonAPI.post(user, %{status: "42 This is :moominmamma #PleromaArt"})
- {:ok, _activity3} = CommonAPI.post(user, %{"status" => "This is :moominmamma"})
+ {:ok, _activity3} = CommonAPI.post(user, %{status: "This is :moominmamma"})
response =
conn
)
user = insert(:user)
- {:ok, activity1} = CommonAPI.post(user, %{"status" => "yeah #PleromaArt"})
+ {:ok, activity1} = CommonAPI.post(user, %{status: "yeah #PleromaArt"})
object = Object.normalize(activity1)
|> Ecto.Changeset.change(data: object_data)
|> Pleroma.Repo.update()
- {:ok, activity2} = CommonAPI.post(user, %{"status" => "42 This is :moominmamma #PleromaArt"})
+ {:ok, activity2} = CommonAPI.post(user, %{status: "42 This is :moominmamma #PleromaArt"})
- {:ok, _activity3} = CommonAPI.post(user, %{"status" => "This is :moominmamma"})
+ {:ok, _activity3} = CommonAPI.post(user, %{status: "This is :moominmamma"})
response =
conn
]
assert xpath(xml, ~x"//channel/item/pubDate/text()"sl) == [
- FeedView.pub_date(activity1.data["published"]),
- FeedView.pub_date(activity2.data["published"])
+ FeedView.pub_date(activity2.data["published"]),
+ FeedView.pub_date(activity1.data["published"])
]
assert xpath(xml, ~x"//channel/item/enclosure/@url"sl) == [
obj2 = Object.normalize(activity2)
assert xpath(xml, ~x"//channel/item/description/text()"sl) == [
- HtmlEntities.decode(FeedView.activity_content(obj2)),
- HtmlEntities.decode(FeedView.activity_content(obj1))
+ HtmlEntities.decode(FeedView.activity_content(obj2.data)),
+ HtmlEntities.decode(FeedView.activity_content(obj1.data))
]
response =