diff options
author | Mark Felder <feld@FreeBSD.org> | 2020-02-18 09:06:27 -0600 |
---|---|---|
committer | Mark Felder <feld@FreeBSD.org> | 2020-02-18 09:06:27 -0600 |
commit | cf943492878c901cf2f0056ee2a8814e0322e9d8 (patch) | |
tree | 3ae91feb1a78eba87b627e216c035956bdba8853 /test/web/mastodon_api/controllers/status_controller_test.exs | |
parent | 514c899275a32e6ef63305f9424c50344d41b12e (diff) | |
parent | cf8307e71c3f68bc26a540783a3ca26766b3b56c (diff) | |
download | pleroma-cf943492878c901cf2f0056ee2a8814e0322e9d8.tar.gz pleroma-cf943492878c901cf2f0056ee2a8814e0322e9d8.zip |
Merge branch 'develop' into gun
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 |