ScheduledActivityControllerTest: Fix tests, make async.
This commit is contained in:
parent
4ba03aa29b
commit
650edb60dc
|
@ -3,15 +3,25 @@
|
||||||
# SPDX-License-Identifier: AGPL-3.0-only
|
# SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
defmodule Pleroma.Web.MastodonAPI.ScheduledActivityControllerTest do
|
defmodule Pleroma.Web.MastodonAPI.ScheduledActivityControllerTest do
|
||||||
use Pleroma.Web.ConnCase
|
use Pleroma.Web.ConnCase, async: true
|
||||||
|
|
||||||
alias Pleroma.Repo
|
alias Pleroma.Repo
|
||||||
alias Pleroma.ScheduledActivity
|
alias Pleroma.ScheduledActivity
|
||||||
|
alias Pleroma.UnstubbedConfigMock, as: ConfigMock
|
||||||
|
|
||||||
import Pleroma.Factory
|
|
||||||
import Ecto.Query
|
import Ecto.Query
|
||||||
|
import Mox
|
||||||
|
import Pleroma.Factory
|
||||||
|
|
||||||
setup do: clear_config([ScheduledActivity, :enabled])
|
setup do
|
||||||
|
ConfigMock
|
||||||
|
|> stub(:get, fn
|
||||||
|
[ScheduledActivity, :enabled] -> true
|
||||||
|
path -> Pleroma.Test.StaticConfig.get(path)
|
||||||
|
end)
|
||||||
|
|
||||||
|
:ok
|
||||||
|
end
|
||||||
|
|
||||||
test "shows scheduled activities" do
|
test "shows scheduled activities" do
|
||||||
%{user: user, conn: conn} = oauth_access(["read:statuses"])
|
%{user: user, conn: conn} = oauth_access(["read:statuses"])
|
||||||
|
@ -55,7 +65,6 @@ test "shows a scheduled activity" do
|
||||||
end
|
end
|
||||||
|
|
||||||
test "updates a scheduled activity" do
|
test "updates a scheduled activity" do
|
||||||
clear_config([ScheduledActivity, :enabled], true)
|
|
||||||
%{user: user, conn: conn} = oauth_access(["write:statuses"])
|
%{user: user, conn: conn} = oauth_access(["write:statuses"])
|
||||||
|
|
||||||
scheduled_at = Timex.shift(NaiveDateTime.utc_now(), minutes: 60)
|
scheduled_at = Timex.shift(NaiveDateTime.utc_now(), minutes: 60)
|
||||||
|
@ -103,7 +112,6 @@ test "updates a scheduled activity" do
|
||||||
end
|
end
|
||||||
|
|
||||||
test "deletes a scheduled activity" do
|
test "deletes a scheduled activity" do
|
||||||
clear_config([ScheduledActivity, :enabled], true)
|
|
||||||
%{user: user, conn: conn} = oauth_access(["write:statuses"])
|
%{user: user, conn: conn} = oauth_access(["write:statuses"])
|
||||||
scheduled_at = Timex.shift(NaiveDateTime.utc_now(), minutes: 60)
|
scheduled_at = Timex.shift(NaiveDateTime.utc_now(), minutes: 60)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue