@@ -34,7 +34,7 @@ defmodule Mobilizon.Federation.ActivityPubTest do
|
||||
date: Signature.generate_date_header()
|
||||
})
|
||||
|
||||
assert signature =~ "headers=\"(request-target) content-length date digest host\""
|
||||
assert signature =~ "headers=\"date host digest content-length (request-target)\""
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -84,7 +84,11 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier.JoinTest do
|
||||
insert(:member, actor: actor_member_2, parent: group, role: :moderator)
|
||||
|
||||
%Event{url: event_url} =
|
||||
insert(:event, organizer_actor: organizer, join_options: :restricted, attributed_to: group)
|
||||
insert(:event,
|
||||
organizer_actor: organizer,
|
||||
join_options: :restricted,
|
||||
attributed_to: group
|
||||
)
|
||||
|
||||
join_data =
|
||||
File.read!("test/fixtures/mobilizon-join-activity.json")
|
||||
|
||||
@@ -62,8 +62,8 @@ defmodule Mobilizon.Service.Auth.LDAPAuthenticatorTest do
|
||||
wholeSubtree: fn -> :ok end,
|
||||
search: fn _connection, _options ->
|
||||
{:ok,
|
||||
{:eldap_search_result, [{:eldap_entry, '', [{'cn', [to_charlist("MyUser")]}]}], [],
|
||||
[]}}
|
||||
{:eldap_search_result, [{:eldap_entry, ~c"", [{~c"cn", [to_charlist("MyUser")]}]}],
|
||||
[], []}}
|
||||
end,
|
||||
close: fn _connection ->
|
||||
send(self(), :close_connection)
|
||||
@@ -111,8 +111,8 @@ defmodule Mobilizon.Service.Auth.LDAPAuthenticatorTest do
|
||||
wholeSubtree: fn -> :ok end,
|
||||
search: fn _connection, _options ->
|
||||
{:ok,
|
||||
{:eldap_search_result, [{:eldap_entry, '', [{'cn', [to_charlist("MyUser")]}]}], [],
|
||||
[]}}
|
||||
{:eldap_search_result, [{:eldap_entry, ~c"", [{~c"cn", [to_charlist("MyUser")]}]}],
|
||||
[], []}}
|
||||
end,
|
||||
close: fn _connection ->
|
||||
send(self(), :close_connection)
|
||||
@@ -149,7 +149,9 @@ defmodule Mobilizon.Service.Auth.LDAPAuthenticatorTest do
|
||||
with_mocks [
|
||||
{:eldap, [],
|
||||
[
|
||||
open: fn [^host], [{:port, ^port}, {:ssl, false} | _] -> {:error, 'connect failed'} end,
|
||||
open: fn [^host], [{:port, ^port}, {:ssl, false} | _] ->
|
||||
{:error, ~c"connect failed"}
|
||||
end,
|
||||
simple_bind: fn _connection, _dn, password ->
|
||||
case password do
|
||||
^admin_password -> :ok
|
||||
@@ -160,7 +162,8 @@ defmodule Mobilizon.Service.Auth.LDAPAuthenticatorTest do
|
||||
wholeSubtree: fn -> :ok end,
|
||||
search: fn _connection, _options ->
|
||||
{:ok,
|
||||
{:eldap_search_result, [{:eldap_entry, '', [{'cn', [to_charlist("MyUser")]}]}], []}}
|
||||
{:eldap_search_result, [{:eldap_entry, ~c"", [{~c"cn", [to_charlist("MyUser")]}]}],
|
||||
[]}}
|
||||
end,
|
||||
close: fn _connection ->
|
||||
send(self(), :close_connection)
|
||||
|
||||
@@ -154,7 +154,11 @@ defmodule Mobilizon.Service.Notifications.SchedulerTest do
|
||||
%User{id: user_id} = user = insert(:user, locale: "fr")
|
||||
|
||||
settings =
|
||||
insert(:settings, user_id: user_id, notification_each_week: true, timezone: "Europe/Paris")
|
||||
insert(:settings,
|
||||
user_id: user_id,
|
||||
notification_each_week: true,
|
||||
timezone: "Europe/Paris"
|
||||
)
|
||||
|
||||
user = Map.put(user, :settings, settings)
|
||||
actor = insert(:actor, user: user)
|
||||
|
||||
@@ -166,7 +166,11 @@ defmodule Mobilizon.Service.Workers.NotificationTest do
|
||||
%User{id: user_id} = user = insert(:user)
|
||||
|
||||
settings =
|
||||
insert(:settings, user_id: user_id, notification_each_week: true, timezone: "Europe/Paris")
|
||||
insert(:settings,
|
||||
user_id: user_id,
|
||||
notification_each_week: true,
|
||||
timezone: "Europe/Paris"
|
||||
)
|
||||
|
||||
user = Map.put(user, :settings, settings)
|
||||
%Actor{} = actor = insert(:actor, user: user)
|
||||
@@ -186,7 +190,11 @@ defmodule Mobilizon.Service.Workers.NotificationTest do
|
||||
%User{id: user_id} = user = insert(:user)
|
||||
|
||||
settings =
|
||||
insert(:settings, user_id: user_id, notification_each_week: true, timezone: "Europe/Paris")
|
||||
insert(:settings,
|
||||
user_id: user_id,
|
||||
notification_each_week: true,
|
||||
timezone: "Europe/Paris"
|
||||
)
|
||||
|
||||
user = %User{user | settings: settings}
|
||||
%Actor{} = actor = insert(:actor, user: user)
|
||||
@@ -210,7 +218,11 @@ defmodule Mobilizon.Service.Workers.NotificationTest do
|
||||
%User{id: user_id} = user = insert(:user)
|
||||
|
||||
settings =
|
||||
insert(:settings, user_id: user_id, notification_each_week: true, timezone: "Europe/Paris")
|
||||
insert(:settings,
|
||||
user_id: user_id,
|
||||
notification_each_week: true,
|
||||
timezone: "Europe/Paris"
|
||||
)
|
||||
|
||||
user = Map.put(user, :settings, settings)
|
||||
%Actor{} = actor = insert(:actor, user: user)
|
||||
@@ -229,7 +241,11 @@ defmodule Mobilizon.Service.Workers.NotificationTest do
|
||||
%User{id: user_id} = user = insert(:user, email: @email)
|
||||
|
||||
settings =
|
||||
insert(:settings, user_id: user_id, notification_each_week: true, timezone: "Europe/Paris")
|
||||
insert(:settings,
|
||||
user_id: user_id,
|
||||
notification_each_week: true,
|
||||
timezone: "Europe/Paris"
|
||||
)
|
||||
|
||||
user = Map.put(user, :settings, settings)
|
||||
%Actor{} = actor = insert(:actor, user: user)
|
||||
|
||||
@@ -23,7 +23,7 @@ defmodule Mobilizon.Web.WebFingerControllerTest do
|
||||
conn = get(conn, "/.well-known/host-meta")
|
||||
|
||||
assert response(conn, 200) ==
|
||||
"<?xml version=\"1.0\" encoding=\"UTF-8\"?><XRD xmlns=\"http://docs.oasis-open.org/ns/xri/xrd-1.0\" xmlns:hm=\"http://host-meta.net/ns/1.0\"><hm:Host>mobilizon.test</hm:Host><Link rel=\"lrdd\" template=\"#{Endpoint.url()}/.well-known/webfinger?resource={uri}\" type=\"application/jrd+json\" /></XRD>"
|
||||
"<?xml version=\"1.0\" encoding=\"UTF-8\"?><XRD xmlns=\"http://docs.oasis-open.org/ns/xri/xrd-1.0\" xmlns:hm=\"http://host-meta.net/ns/1.0\"><hm:Host>mobilizon.test</hm:Host><Link type=\"application/jrd+json\" template=\"#{Endpoint.url()}/.well-known/webfinger?resource={uri}\" rel=\"lrdd\" /></XRD>"
|
||||
|
||||
assert {"content-type", "application/xrd+xml; charset=utf-8"} in conn.resp_headers
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user