diff options
author | lain <lain@soykaf.club> | 2020-04-22 14:26:19 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-04-22 14:26:19 +0200 |
commit | c10485db163d56acd7206980f91f0e51153ef36a (patch) | |
tree | bedb57c96260893aa4c63390e36136260efa2f5a /test | |
parent | c466e739b6cfe21e68fb10805f7747ea74d76f74 (diff) | |
download | pleroma-c10485db163d56acd7206980f91f0e51153ef36a.tar.gz pleroma-c10485db163d56acd7206980f91f0e51153ef36a.zip |
StatusController: Ignore nil scheduled_at parameters.
Diffstat (limited to 'test')
-rw-r--r-- | test/web/mastodon_api/controllers/status_controller_test.exs | 11 |
1 files changed, 11 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 162f7b1b2..85068edd0 100644 --- a/test/web/mastodon_api/controllers/status_controller_test.exs +++ b/test/web/mastodon_api/controllers/status_controller_test.exs @@ -302,6 +302,17 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do assert [] == Repo.all(Activity) end + test "ignores nil values", %{conn: conn} do + conn = + post(conn, "/api/v1/statuses", %{ + "status" => "not scheduled", + "scheduled_at" => nil + }) + + assert result = json_response(conn, 200) + assert Activity.get_by_id(result["id"]) + end + test "creates a scheduled activity with a media attachment", %{user: user, conn: conn} do scheduled_at = NaiveDateTime.add(NaiveDateTime.utc_now(), :timer.minutes(120), :millisecond) |