Change set_reachable/1 to an upsert

This commit is contained in:
Mark Felder 2023-12-05 16:35:41 -05:00
commit 1ad0d94d6f
3 changed files with 4 additions and 15 deletions

View file

@ -31,14 +31,6 @@ defmodule Pleroma.Instances.InstanceTest do
assert {:ok, instance} = Instance.set_reachable(instance.host)
refute instance.unreachable_since
end
test "does NOT create an Instance record in case of no existing matching record" do
host = "domain.org"
assert nil == Instance.set_reachable(host)
assert [] = Repo.all(Ecto.Query.from(i in Instance))
assert Instance.reachable?(host)
end
end
describe "set_unreachable/1" do