aboutsummaryrefslogtreecommitdiff
path: root/test/web/instances
diff options
context:
space:
mode:
authorIvan Tashkinov <ivantashkinov@gmail.com>2019-01-29 13:12:28 +0300
committerIvan Tashkinov <ivantashkinov@gmail.com>2019-01-29 13:12:28 +0300
commit92753b0cd9cfcdc5edb64a5e55ad27f73079f9e0 (patch)
tree606de2d652366d27ce34faebf3ad4274facfd15d /test/web/instances
parentd3f9e6f6fed382ede8e314c370c21e84a119f65a (diff)
downloadpleroma-92753b0cd9cfcdc5edb64a5e55ad27f73079f9e0.tar.gz
[#534] Made federation push sender be determined basing on content instead of `referer` header. Updated tests.
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