projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update install docs (#38)
[akkoma]
/
test
/
pleroma
/
web
/
federator_test.exs
diff --git
a/test/pleroma/web/federator_test.exs
b/test/pleroma/web/federator_test.exs
index 592fdccd19168a86f3c42ff95f448a5c13df977a..372b6a73acd736d799c0a1262917ad1fdc04eb66 100644
(file)
--- a/
test/pleroma/web/federator_test.exs
+++ b/
test/pleroma/web/federator_test.exs
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-202
0
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-202
1
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.FederatorTest do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.FederatorTest do
@@
-56,7
+56,7
@@
defmodule Pleroma.Web.FederatorTest do
activity: activity,
relay_mock: relay_mock
} do
activity: activity,
relay_mock: relay_mock
} do
-
Pleroma.Config.put
([:instance, :allow_relay], false)
+
clear_config
([:instance, :allow_relay], false)
with_mocks([relay_mock]) do
Federator.publish(activity)
with_mocks([relay_mock]) do
Federator.publish(activity)
@@
-123,7
+123,8
@@
defmodule Pleroma.Web.FederatorTest do
"type" => "Note",
"content" => "hi world!",
"id" => "http://mastodon.example.org/users/admin/objects/1",
"type" => "Note",
"content" => "hi world!",
"id" => "http://mastodon.example.org/users/admin/objects/1",
- "attributedTo" => "http://mastodon.example.org/users/admin"
+ "attributedTo" => "http://mastodon.example.org/users/admin",
+ "to" => ["https://www.w3.org/ns/activitystreams#Public"]
},
"to" => ["https://www.w3.org/ns/activitystreams#Public"]
}
},
"to" => ["https://www.w3.org/ns/activitystreams#Public"]
}
@@
-145,7
+146,8
@@
defmodule Pleroma.Web.FederatorTest do
"type" => "Note",
"content" => "hi world!",
"id" => "http://mastodon.example.org/users/admin/objects/1",
"type" => "Note",
"content" => "hi world!",
"id" => "http://mastodon.example.org/users/admin/objects/1",
- "attributedTo" => "http://mastodon.example.org/users/admin"
+ "attributedTo" => "http://mastodon.example.org/users/admin",
+ "to" => ["https://www.w3.org/ns/activitystreams#Public"]
},
"to" => ["https://www.w3.org/ns/activitystreams#Public"]
}
},
"to" => ["https://www.w3.org/ns/activitystreams#Public"]
}
@@
-155,16
+157,16
@@
defmodule Pleroma.Web.FederatorTest do
end
test "it does not crash if MRF rejects the post" do
end
test "it does not crash if MRF rejects the post" do
-
Pleroma.Config.put
([:mrf_keyword, :reject], ["lain"])
+
clear_config
([:mrf_keyword, :reject], ["lain"])
-
Pleroma.Config.put
(
+
clear_config
(
[:mrf, :policies],
Pleroma.Web.ActivityPub.MRF.KeywordPolicy
)
params =
File.read!("test/fixtures/mastodon-post-activity.json")
[:mrf, :policies],
Pleroma.Web.ActivityPub.MRF.KeywordPolicy
)
params =
File.read!("test/fixtures/mastodon-post-activity.json")
- |>
Poi
son.decode!()
+ |>
Ja
son.decode!()
assert {:ok, job} = Federator.incoming_ap_doc(params)
assert {:error, _} = ObanHelpers.perform(job)
assert {:ok, job} = Federator.incoming_ap_doc(params)
assert {:error, _} = ObanHelpers.perform(job)