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/controllers/status_controller_test.exs | |
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/controllers/status_controller_test.exs')
-rw-r--r-- | test/web/mastodon_api/controllers/status_controller_test.exs | 19 |
1 files changed, 19 insertions, 0 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 |