Add a test
This commit is contained in:
parent
2ef70b55f5
commit
ca7ac068f0
1 changed files with 19 additions and 0 deletions
|
@ -1254,4 +1254,23 @@ test "returns the favorites of a user" 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
|
||||
|
|
Loading…
Reference in a new issue