aboutsummaryrefslogtreecommitdiff
path: root/test/web
diff options
context:
space:
mode:
authorTristan Mahé <gled@remote-shell.net>2018-07-19 17:44:18 -0700
committerTristan Mahé <gled@remote-shell.net>2018-07-19 17:44:18 -0700
commitbc2668bb63aee2c42cdea48782ba5ef291c17b45 (patch)
tree838d334208c4dadf23b974181c0ad4c17b199f8c /test/web
parent5469fb9561bb886deb8434e545dfb711eb20f341 (diff)
parent41b0ecef959df0a1cda71e56e256cacebe48d56f (diff)
downloadpleroma-bc2668bb63aee2c42cdea48782ba5ef291c17b45.tar.gz
Merge remote-tracking branch 'upstream/develop' into feature/filter_exif
Diffstat (limited to 'test/web')
-rw-r--r--test/web/activity_pub/activity_pub_test.exs9
-rw-r--r--test/web/mastodon_api/mastodon_api_controller_test.exs5
-rw-r--r--test/web/mastodon_api/status_view_test.exs3
-rw-r--r--test/web/ostatus/ostatus_controller_test.exs25
4 files changed, 40 insertions, 2 deletions
diff --git a/test/web/activity_pub/activity_pub_test.exs b/test/web/activity_pub/activity_pub_test.exs
index bc33b4dfc..90c0bd768 100644
--- a/test/web/activity_pub/activity_pub_test.exs
+++ b/test/web/activity_pub/activity_pub_test.exs
@@ -476,6 +476,15 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
end
end
+ test "it can fetch plume articles" do
+ {:ok, object} =
+ ActivityPub.fetch_object_from_id(
+ "https://baptiste.gelez.xyz/~/PlumeDevelopment/this-month-in-plume-june-2018/"
+ )
+
+ assert object
+ end
+
describe "update" do
test "it creates an update activity with the new user data" do
user = insert(:user)
diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs
index d1812457d..9e33c1d04 100644
--- a/test/web/mastodon_api/mastodon_api_controller_test.exs
+++ b/test/web/mastodon_api/mastodon_api_controller_test.exs
@@ -736,16 +736,19 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
filename: "an_image.jpg"
}
+ desc = "Description of the image"
+
user = insert(:user)
conn =
conn
|> assign(:user, user)
- |> post("/api/v1/media", %{"file" => file})
+ |> post("/api/v1/media", %{"file" => file, "description" => desc})
assert media = json_response(conn, 200)
assert media["type"] == "image"
+ assert media["description"] == desc
end
test "hashtag timeline", %{conn: conn} do
diff --git a/test/web/mastodon_api/status_view_test.exs b/test/web/mastodon_api/status_view_test.exs
index d28c3cbad..03c798bef 100644
--- a/test/web/mastodon_api/status_view_test.exs
+++ b/test/web/mastodon_api/status_view_test.exs
@@ -102,7 +102,8 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
url: "someurl",
remote_url: "someurl",
preview_url: "someurl",
- text_url: "someurl"
+ text_url: "someurl",
+ description: nil
}
assert expected == StatusView.render("attachment.json", %{attachment: object})
diff --git a/test/web/ostatus/ostatus_controller_test.exs b/test/web/ostatus/ostatus_controller_test.exs
index d5adf3bf3..c23b175e8 100644
--- a/test/web/ostatus/ostatus_controller_test.exs
+++ b/test/web/ostatus/ostatus_controller_test.exs
@@ -155,6 +155,31 @@ defmodule Pleroma.Web.OStatus.OStatusControllerTest do
assert response(conn, 200)
end
+ test "gets a notice in AS2 format", %{conn: conn} do
+ note_activity = insert(:note_activity)
+ url = "/notice/#{note_activity.id}"
+
+ conn =
+ conn
+ |> put_req_header("accept", "application/activity+json")
+ |> get(url)
+
+ assert json_response(conn, 200)
+ end
+
+ test "gets an activity in AS2 format", %{conn: conn} do
+ note_activity = insert(:note_activity)
+ [_, uuid] = hd(Regex.scan(~r/.+\/([\w-]+)$/, note_activity.data["id"]))
+ url = "/activities/#{uuid}"
+
+ conn =
+ conn
+ |> put_req_header("accept", "application/activity+json")
+ |> get(url)
+
+ assert json_response(conn, 200)
+ end
+
test "404s a private notice", %{conn: conn} do
note_activity = insert(:direct_note_activity)
url = "/notice/#{note_activity.id}"