Test refreshing instances does not update self relay actor
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
28
test/service/workers/refresh_instances_test.exs
Normal file
28
test/service/workers/refresh_instances_test.exs
Normal file
@@ -0,0 +1,28 @@
|
||||
defmodule Mobilizon.Service.Workers.RefreshInstancesTest do
|
||||
@moduledoc """
|
||||
Test the refresh instance module
|
||||
"""
|
||||
|
||||
alias Mobilizon.Actors.Actor
|
||||
alias Mobilizon.Federation.ActivityPub.Relay
|
||||
alias Mobilizon.Instances.Instance
|
||||
alias Mobilizon.Service.Workers.RefreshInstances
|
||||
|
||||
use Mobilizon.DataCase
|
||||
|
||||
describe "Refresh instance actor" do
|
||||
test "unless if local actor" do
|
||||
# relay = Mobilizon.Web.Relay.get_actor()
|
||||
assert {:error, :not_remote_instance} ==
|
||||
RefreshInstances.refresh_instance_actor(%Instance{domain: nil})
|
||||
end
|
||||
|
||||
test "unless if local relay actor" do
|
||||
%Actor{url: url} = Relay.get_actor()
|
||||
%URI{host: domain} = URI.new!(url)
|
||||
|
||||
assert {:error, :not_remote_instance} ==
|
||||
RefreshInstances.refresh_instance_actor(%Instance{domain: domain})
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user