projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'fix/2047-rich-media-parser' into 'develop'
[akkoma]
/
test
/
web
/
web_finger
/
web_finger_test.exs
diff --git
a/test/web/web_finger/web_finger_test.exs
b/test/web/web_finger/web_finger_test.exs
index 5aa8c73cf8d01c8036eba217ad40ad6676cb3423..96fc0bbaa7b1419fe1230468d262c16df41cfca3 100644
(file)
--- a/
test/web/web_finger/web_finger_test.exs
+++ b/
test/web/web_finger/web_finger_test.exs
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-20
19
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-20
20
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.WebFingerTest do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.WebFingerTest do
@@
-40,6
+40,11
@@
defmodule Pleroma.Web.WebFingerTest do
end
describe "fingering" do
end
describe "fingering" do
+ test "returns error for nonsensical input" do
+ assert {:error, _} = WebFinger.finger("bliblablu")
+ assert {:error, _} = WebFinger.finger("pleroma.social")
+ end
+
test "returns error when fails parse xml or json" do
user = "invalid_content@social.heldscal.la"
assert {:error, %Jason.DecodeError{}} = WebFinger.finger(user)
test "returns error when fails parse xml or json" do
user = "invalid_content@social.heldscal.la"
assert {:error, %Jason.DecodeError{}} = WebFinger.finger(user)
@@
-67,7
+72,7
@@
defmodule Pleroma.Web.WebFingerTest do
assert data["magic_key"] == nil
assert data["salmon"] == nil
assert data["magic_key"] == nil
assert data["salmon"] == nil
- assert data["topic"] ==
"https://mstdn.jp/users/kPherox.atom"
+ assert data["topic"] ==
nil
assert data["subject"] == "acct:kPherox@mstdn.jp"
assert data["ap_id"] == "https://mstdn.jp/users/kPherox"
assert data["subscribe_address"] == "https://mstdn.jp/authorize_interaction?acct={uri}"
assert data["subject"] == "acct:kPherox@mstdn.jp"
assert data["ap_id"] == "https://mstdn.jp/users/kPherox"
assert data["subscribe_address"] == "https://mstdn.jp/authorize_interaction?acct={uri}"