aboutsummaryrefslogtreecommitdiff
path: root/test/web/instances
diff options
context:
space:
mode:
Diffstat (limited to 'test/web/instances')
-rw-r--r--test/web/instances/instances_test.exs18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/web/instances/instances_test.exs b/test/web/instances/instances_test.exs
index a2fdf1019..adb8560a7 100644
--- a/test/web/instances/instances_test.exs
+++ b/test/web/instances/instances_test.exs
@@ -39,6 +39,11 @@ defmodule Pleroma.InstancesTest do
assert Instances.reachable?(url)
assert Instances.reachable?(URI.parse(url).host)
end
+
+ test "returns true on non-binary input" do
+ assert Instances.reachable?(nil)
+ assert Instances.reachable?(1)
+ end
end
describe "filter_reachable/1" do
@@ -71,6 +76,19 @@ defmodule Pleroma.InstancesTest do
Instances.set_reachable(url)
assert Instances.reachable?(url)
end
+
+ test "returns error status on non-binary input" do
+ assert {:error, _} = Instances.set_reachable(nil)
+ assert {:error, _} = Instances.set_reachable(1)
+ end
+ end
+
+ # Note: implementation-specific (e.g. Instance) details of set_unreachable/1 should be tested in implementation-specific tests
+ describe "set_unreachable/1" do
+ test "returns error status on non-binary input" do
+ assert {:error, _} = Instances.set_unreachable(nil)
+ assert {:error, _} = Instances.set_unreachable(1)
+ end
end
describe "set_consistently_unreachable/1" do