[#1149] Fixed failing tests. Ensured Instance.set_unreachable/2 supports ISO 8601 datetime.
This commit is contained in:
parent
267262491e
commit
33a5fc4a70
6 changed files with 20 additions and 6 deletions
|
|
@ -28,6 +28,8 @@ defmodule Pleroma.ConversationTest do
|
|||
{:ok, _activity} =
|
||||
CommonAPI.post(user, %{"visibility" => "direct", "status" => "hey @#{other_user.nickname}"})
|
||||
|
||||
Pleroma.ObanHelpers.perform_all()
|
||||
|
||||
Repo.delete_all(Conversation)
|
||||
Repo.delete_all(Conversation.Participation)
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,12 @@ defmodule Pleroma.ObanHelpers do
|
|||
|
||||
alias Pleroma.Repo
|
||||
|
||||
def perform_all do
|
||||
Oban.Job
|
||||
|> Repo.all()
|
||||
|> perform()
|
||||
end
|
||||
|
||||
def perform(%Oban.Job{} = job) do
|
||||
res = apply(String.to_existing_atom("Elixir." <> job.worker), :perform, [job])
|
||||
Repo.delete(job)
|
||||
|
|
|
|||
|
|
@ -249,7 +249,8 @@ defmodule Pleroma.Web.FederatorTest do
|
|||
File.read!("test/fixtures/mastodon-post-activity.json")
|
||||
|> Poison.decode!()
|
||||
|
||||
assert Federator.incoming_ap_doc(params) == :error
|
||||
assert {:ok, job} = Federator.incoming_ap_doc(params)
|
||||
assert :error = ObanHelpers.perform(job)
|
||||
|
||||
Pleroma.Config.put([:instance, :rewrite_policy], policies)
|
||||
Pleroma.Config.put(:mrf_keyword, mrf_keyword_policy)
|
||||
|
|
|
|||
|
|
@ -22,7 +22,8 @@ defmodule Pleroma.Instances.InstanceTest do
|
|||
|
||||
describe "set_reachable/1" do
|
||||
test "clears `unreachable_since` of existing matching Instance record having non-nil `unreachable_since`" do
|
||||
instance = insert(:instance, unreachable_since: NaiveDateTime.utc_now())
|
||||
unreachable_since = NaiveDateTime.to_iso8601(NaiveDateTime.utc_now())
|
||||
instance = insert(:instance, unreachable_since: unreachable_since)
|
||||
|
||||
assert {:ok, instance} = Instance.set_reachable(instance.host)
|
||||
refute instance.unreachable_since
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue