summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2020-04-23 11:22:30 +0000
committerrinpatch <rinpatch@sdf.org>2020-04-23 11:22:30 +0000
commit25eec6d72dae6e771b777aa6460acd600a17fe7d (patch)
tree11757ad17a018778f09660a59f7613264c25e917 /test
parent850377a7b8d380088d8717d82b09a2976bbdd739 (diff)
parentc10485db163d56acd7206980f91f0e51153ef36a (diff)
downloadpleroma-25eec6d72dae6e771b777aa6460acd600a17fe7d.tar.gz
pleroma-25eec6d72dae6e771b777aa6460acd600a17fe7d.zip
Merge branch 'bugfix/null-scheduled-at' into 'develop'
StatusController: Ignore nil scheduled_at parameters. Closes #1699 See merge request pleroma/pleroma!2412
Diffstat (limited to 'test')
-rw-r--r--test/web/mastodon_api/controllers/status_controller_test.exs11
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)