projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'fix/oauth-http-basic' into 'develop'
[akkoma]
/
test
/
web
/
salmon
/
salmon_test.exs
diff --git
a/test/web/salmon/salmon_test.exs
b/test/web/salmon/salmon_test.exs
index cf70c908f364181779c3a68b20e07845e791382b..1b39b4b2d70d4c15dfcf8a821a6491e5a1f6a304 100644
(file)
--- a/
test/web/salmon/salmon_test.exs
+++ b/
test/web/salmon/salmon_test.exs
@@
-22,7
+22,7
@@
defmodule Pleroma.Web.Salmon.SalmonTest do
end
test "generates an RSA private key pem" do
end
test "generates an RSA private key pem" do
- {:ok, key} = Salmon.generate_rsa_pem
+ {:ok, key} = Salmon.generate_rsa_pem
()
assert is_binary(key)
assert Regex.match?(~r/RSA/, key)
end
assert is_binary(key)
assert Regex.match?(~r/RSA/, key)
end
@@
-62,7
+62,8
@@
defmodule Pleroma.Web.Salmon.SalmonTest do
salmon = File.read!("test/fixtures/salmon2.xml")
{:ok, key} = Salmon.fetch_magic_key(salmon)
salmon = File.read!("test/fixtures/salmon2.xml")
{:ok, key} = Salmon.fetch_magic_key(salmon)
- assert key == "RSA.uzg6r1peZU0vXGADWxGJ0PE34WvmhjUmydbX5YYdOiXfODVLwCMi1umGoqUDm-mRu4vNEdFBVJU1CpFA7dKzWgIsqsa501i2XqElmEveXRLvNRWFB6nG03Q5OUY2as8eE54BJm0p20GkMfIJGwP6TSFb-ICp3QjzbatuSPJ6xCE=.AQAB"
+ assert key ==
+ "RSA.uzg6r1peZU0vXGADWxGJ0PE34WvmhjUmydbX5YYdOiXfODVLwCMi1umGoqUDm-mRu4vNEdFBVJU1CpFA7dKzWgIsqsa501i2XqElmEveXRLvNRWFB6nG03Q5OUY2as8eE54BJm0p20GkMfIJGwP6TSFb-ICp3QjzbatuSPJ6xCE=.AQAB"
end
test "it pushes an activity to remote accounts it's addressed to" do
end
test "it pushes an activity to remote accounts it's addressed to" do
@@
-75,13
+76,14
@@
defmodule Pleroma.Web.Salmon.SalmonTest do
mentioned_user = insert(:user, user_data)
note = insert(:note)
mentioned_user = insert(:user, user_data)
note = insert(:note)
+
activity_data = %{
activity_data = %{
- "id" => Pleroma.Web.ActivityPub.Utils.generate_activity_id,
+ "id" => Pleroma.Web.ActivityPub.Utils.generate_activity_id
()
,
"type" => "Create",
"actor" => note.data["actor"],
"to" => note.data["to"] ++ [mentioned_user.ap_id],
"object" => note.data,
"type" => "Create",
"actor" => note.data["actor"],
"to" => note.data["to"] ++ [mentioned_user.ap_id],
"object" => note.data,
- "published_at" => DateTime.utc_now() |> DateTime.to_iso8601,
+ "published_at" => DateTime.utc_now() |> DateTime.to_iso8601
()
,
"context" => note.data["context"]
}
"context" => note.data["context"]
}
@@
-89,9
+91,10
@@
defmodule Pleroma.Web.Salmon.SalmonTest do
user = Repo.get_by(User, ap_id: activity.data["actor"])
{:ok, user} = Pleroma.Web.WebFinger.ensure_keys_present(user)
user = Repo.get_by(User, ap_id: activity.data["actor"])
{:ok, user} = Pleroma.Web.WebFinger.ensure_keys_present(user)
- poster = fn
(url, _data, _headers, _options)
->
+ poster = fn
url, _data, _headers, _options
->
assert url == "http://example.org/salmon"
end
assert url == "http://example.org/salmon"
end
+
Salmon.publish(user, activity, poster)
end
end
Salmon.publish(user, activity, poster)
end
end