From 92753b0cd9cfcdc5edb64a5e55ad27f73079f9e0 Mon Sep 17 00:00:00 2001 From: Ivan Tashkinov Date: Tue, 29 Jan 2019 13:12:28 +0300 Subject: [#534] Made federation push sender be determined basing on content instead of `referer` header. Updated tests. --- test/web/instances/instances_test.exs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test/web/instances') 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 -- cgit v1.2.3