summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlexander Strizhakov <alex.strizhakov@gmail.com>2021-03-02 17:24:06 +0300
committerAlexander Strizhakov <alex.strizhakov@gmail.com>2021-03-25 13:03:40 +0300
commitff612750b1bae5223bca76b34a39e7d2bd05770c (patch)
treefa3eba5ca2db103dccbbb70cdea6308afc6c2b71 /test
parent17f28c0507e3c34ce75e63747eed9abb66713e6e (diff)
downloadpleroma-ff612750b1bae5223bca76b34a39e7d2bd05770c.tar.gz
pleroma-ff612750b1bae5223bca76b34a39e7d2bd05770c.zip
validator renaming & add validation for target
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/web/activity_pub/transmogrifier_test.exs2
-rw-r--r--test/pleroma/web/mastodon_api/controllers/status_controller_test.exs6
-rw-r--r--test/support/http_request_mock.ex3
3 files changed, 6 insertions, 5 deletions
diff --git a/test/pleroma/web/activity_pub/transmogrifier_test.exs b/test/pleroma/web/activity_pub/transmogrifier_test.exs
index 28d7e1e3c..9bc27f89e 100644
--- a/test/pleroma/web/activity_pub/transmogrifier_test.exs
+++ b/test/pleroma/web/activity_pub/transmogrifier_test.exs
@@ -168,7 +168,7 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
"id" => "http://localhost:400/objects/d61d6733-e256-4fe1-ab13-1e369789423d",
"actor" => actor,
"object" => object_url,
- "target" => "http://example.com/users/lain/collections/featured",
+ "target" => "https://example.com/users/lain/collections/featured",
"type" => "Remove",
"to" => [Pleroma.Constants.as_public()],
"cc" => ["https://example.com/users/lain/followers"]
diff --git a/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs
index e0d642910..99ad87d05 100644
--- a/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs
+++ b/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs
@@ -1209,15 +1209,15 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
setup do: clear_config([:instance, :max_pinned_statuses], 1)
test "pin status", %{conn: conn, user: user, activity: activity} do
- id_str = to_string(activity.id)
+ id = activity.id
- assert %{"id" => ^id_str, "pinned" => true} =
+ assert %{"id" => ^id, "pinned" => true} =
conn
|> put_req_header("content-type", "application/json")
|> post("/api/v1/statuses/#{activity.id}/pin")
|> json_response_and_validate_schema(200)
- assert [%{"id" => ^id_str, "pinned" => true}] =
+ assert [%{"id" => ^id, "pinned" => true}] =
conn
|> get("/api/v1/accounts/#{user.id}/statuses?pinned=true")
|> json_response_and_validate_schema(200)
diff --git a/test/support/http_request_mock.ex b/test/support/http_request_mock.ex
index 9e9f1c86c..8807c2d14 100644
--- a/test/support/http_request_mock.ex
+++ b/test/support/http_request_mock.ex
@@ -924,7 +924,8 @@ defmodule HttpRequestMock do
body:
File.read!("test/fixtures/users_mock/masto_featured.json")
|> String.replace("{{domain}}", "mastodon.social")
- |> String.replace("{{nickname}}", "lambadalambda")
+ |> String.replace("{{nickname}}", "lambadalambda"),
+ headers: activitypub_object_headers()
}}
end