diff options
author | feld <feld@feld.me> | 2020-02-18 20:58:15 +0000 |
---|---|---|
committer | feld <feld@feld.me> | 2020-02-18 20:58:15 +0000 |
commit | 53a7680c161d3bc7b046ec576e5269de668f547f (patch) | |
tree | 0b65513f42a8959b705d6e8b74d80a160becf74b /test/web/mastodon_api | |
parent | 589bffa57d30b1133f951d0a6788c6f956f798a6 (diff) | |
parent | 3416948cdf048421fb042fb71f54d2868d291aca (diff) | |
download | pleroma-53a7680c161d3bc7b046ec576e5269de668f547f.tar.gz pleroma-53a7680c161d3bc7b046ec576e5269de668f547f.zip |
Merge branch 'develop' into 'fix/mrf-sample-doc'
# Conflicts:
# docs/configuration/mrf.md
Diffstat (limited to 'test/web/mastodon_api')
-rw-r--r-- | test/web/mastodon_api/controllers/status_controller_test.exs | 19 | ||||
-rw-r--r-- | test/web/mastodon_api/views/status_view_test.exs | 4 |
2 files changed, 21 insertions, 2 deletions
diff --git a/test/web/mastodon_api/controllers/status_controller_test.exs b/test/web/mastodon_api/controllers/status_controller_test.exs index 810f371cb..fd2e40ce2 100644 --- a/test/web/mastodon_api/controllers/status_controller_test.exs +++ b/test/web/mastodon_api/controllers/status_controller_test.exs @@ -1254,4 +1254,23 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do assert [] = json_response(third_conn, 200) end + + test "expires_at is nil for another user" do + %{conn: conn, user: user} = oauth_access(["read:statuses"]) + {:ok, activity} = CommonAPI.post(user, %{"status" => "foobar", "expires_in" => 1_000_000}) + + expires_at = + activity.id + |> ActivityExpiration.get_by_activity_id() + |> Map.get(:scheduled_at) + |> NaiveDateTime.to_iso8601() + + assert %{"pleroma" => %{"expires_at" => ^expires_at}} = + conn |> get("/api/v1/statuses/#{activity.id}") |> json_response(:ok) + + %{conn: conn} = oauth_access(["read:statuses"]) + + assert %{"pleroma" => %{"expires_at" => nil}} = + conn |> get("/api/v1/statuses/#{activity.id}") |> json_response(:ok) + end end diff --git a/test/web/mastodon_api/views/status_view_test.exs b/test/web/mastodon_api/views/status_view_test.exs index ba58e48e8..560f8179f 100644 --- a/test/web/mastodon_api/views/status_view_test.exs +++ b/test/web/mastodon_api/views/status_view_test.exs @@ -491,7 +491,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do title: "Example website" } - %{provider_name: "Example site name"} = + %{provider_name: "example.com"} = StatusView.render("card.json", %{page_url: page_url, rich_media: card}) end @@ -506,7 +506,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do description: "Example description" } - %{provider_name: "Example site name"} = + %{provider_name: "example.com"} = StatusView.render("card.json", %{page_url: page_url, rich_media: card}) end end |