projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Support validation for inline OpenAPI schema and automatic tests for examples
[akkoma]
/
test
/
web
/
mastodon_api
/
controllers
/
status_controller_test.exs
diff --git
a/test/web/mastodon_api/controllers/status_controller_test.exs
b/test/web/mastodon_api/controllers/status_controller_test.exs
index 162f7b1b2ccdb36d01ec87c35b24cec2ccbd39b5..85068edd00eddf9a0551073ed6273d1962604f6d 100644
(file)
--- 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
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)
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)