projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'refactor/db-not-null-constraints-for-config' into 'develop'
[akkoma]
/
test
/
web
/
activity_pub
/
transmogrifier_test.exs
diff --git
a/test/web/activity_pub/transmogrifier_test.exs
b/test/web/activity_pub/transmogrifier_test.exs
index 77e041b4a4fa5de4112b59baf948b1d46ed69217..6f7e1da1f65fc9eea293dd307efba4e0df3bf970 100644
(file)
--- a/
test/web/activity_pub/transmogrifier_test.exs
+++ b/
test/web/activity_pub/transmogrifier_test.exs
@@
-145,7
+145,7
@@
defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
user = User.get_cached_by_ap_id(object_data["actor"])
user = User.get_cached_by_ap_id(object_data["actor"])
- assert user.
info.
note_count == 1
+ assert user.note_count == 1
end
test "it works for incoming notices with hashtags" do
end
test "it works for incoming notices with hashtags" do
@@
-582,7
+582,7
@@
defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
}
]
}
]
- assert user.
info.
banner["url"] == [
+ assert user.banner["url"] == [
%{
"href" =>
"https://cd.niu.moe/accounts/headers/000/033/323/original/850b3448fa5fd477.png"
%{
"href" =>
"https://cd.niu.moe/accounts/headers/000/033/323/original/850b3448fa5fd477.png"
@@
-601,7
+601,7
@@
defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
user = User.get_cached_by_ap_id(activity.actor)
user = User.get_cached_by_ap_id(activity.actor)
- assert User.
Info.fields(user.info
) == [
+ assert User.
fields(user
) == [
%{"name" => "foo", "value" => "bar"},
%{"name" => "foo1", "value" => "bar1"}
]
%{"name" => "foo", "value" => "bar"},
%{"name" => "foo1", "value" => "bar1"}
]
@@
-622,7
+622,7
@@
defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
user = User.get_cached_by_ap_id(user.ap_id)
user = User.get_cached_by_ap_id(user.ap_id)
- assert User.
Info.fields(user.info
) == [
+ assert User.
fields(user
) == [
%{"name" => "foo", "value" => "updated"},
%{"name" => "foo1", "value" => "updated"}
]
%{"name" => "foo", "value" => "updated"},
%{"name" => "foo1", "value" => "updated"}
]
@@
-640,7
+640,7
@@
defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
user = User.get_cached_by_ap_id(user.ap_id)
user = User.get_cached_by_ap_id(user.ap_id)
- assert User.
Info.fields(user.info
) == [
+ assert User.
fields(user
) == [
%{"name" => "foo", "value" => "updated"},
%{"name" => "foo1", "value" => "updated"}
]
%{"name" => "foo", "value" => "updated"},
%{"name" => "foo1", "value" => "updated"}
]
@@
-651,7
+651,7
@@
defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
user = User.get_cached_by_ap_id(user.ap_id)
user = User.get_cached_by_ap_id(user.ap_id)
- assert User.
Info.fields(user.info
) == []
+ assert User.
fields(user
) == []
end
test "it works for incoming update activities which lock the account" do
end
test "it works for incoming update activities which lock the account" do
@@
-674,7
+674,7
@@
defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
{:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(update_data)
user = User.get_cached_by_ap_id(data["actor"])
{:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(update_data)
user = User.get_cached_by_ap_id(data["actor"])
- assert user.
info.
locked == true
+ assert user.locked == true
end
test "it works for incoming deletes" do
end
test "it works for incoming deletes" do
@@
-720,7
+720,7
@@
defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
assert capture_log(fn ->
:error = Transmogrifier.handle_incoming(data)
end) =~
assert capture_log(fn ->
:error = Transmogrifier.handle_incoming(data)
end) =~
- "[error] Could not decode user at fetch http://mastodon.example.org/users/gargron, {:error,
{:error, :nxdomain}
}"
+ "[error] Could not decode user at fetch http://mastodon.example.org/users/gargron, {:error,
:nxdomain
}"
assert Activity.get_by_id(activity.id)
end
assert Activity.get_by_id(activity.id)
end
@@
-915,7
+915,7
@@
defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
test "it works for incoming accepts which were orphaned" do
follower = insert(:user)
test "it works for incoming accepts which were orphaned" do
follower = insert(:user)
- followed = insert(:user,
%{info: %User.Info{locked: true}}
)
+ followed = insert(:user,
locked: true
)
{:ok, follow_activity} = ActivityPub.follow(follower, followed)
{:ok, follow_activity} = ActivityPub.follow(follower, followed)
@@
-937,7
+937,7
@@
defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
test "it works for incoming accepts which are referenced by IRI only" do
follower = insert(:user)
test "it works for incoming accepts which are referenced by IRI only" do
follower = insert(:user)
- followed = insert(:user,
%{info: %User.Info{locked: true}}
)
+ followed = insert(:user,
locked: true
)
{:ok, follow_activity} = ActivityPub.follow(follower, followed)
{:ok, follow_activity} = ActivityPub.follow(follower, followed)
@@
-957,7
+957,7
@@
defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
test "it fails for incoming accepts which cannot be correlated" do
follower = insert(:user)
test "it fails for incoming accepts which cannot be correlated" do
follower = insert(:user)
- followed = insert(:user,
%{info: %User.Info{locked: true}}
)
+ followed = insert(:user,
locked: true
)
accept_data =
File.read!("test/fixtures/mastodon-accept-activity.json")
accept_data =
File.read!("test/fixtures/mastodon-accept-activity.json")
@@
-976,7
+976,7
@@
defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
test "it fails for incoming rejects which cannot be correlated" do
follower = insert(:user)
test "it fails for incoming rejects which cannot be correlated" do
follower = insert(:user)
- followed = insert(:user,
%{info: %User.Info{locked: true}}
)
+ followed = insert(:user,
locked: true
)
accept_data =
File.read!("test/fixtures/mastodon-reject-activity.json")
accept_data =
File.read!("test/fixtures/mastodon-reject-activity.json")
@@
-995,7
+995,7
@@
defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
test "it works for incoming rejects which are orphaned" do
follower = insert(:user)
test "it works for incoming rejects which are orphaned" do
follower = insert(:user)
- followed = insert(:user,
%{info: %User.Info{locked: true}}
)
+ followed = insert(:user,
locked: true
)
{:ok, follower} = User.follow(follower, followed)
{:ok, _follow_activity} = ActivityPub.follow(follower, followed)
{:ok, follower} = User.follow(follower, followed)
{:ok, _follow_activity} = ActivityPub.follow(follower, followed)
@@
-1021,7
+1021,7
@@
defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
test "it works for incoming rejects which are referenced by IRI only" do
follower = insert(:user)
test "it works for incoming rejects which are referenced by IRI only" do
follower = insert(:user)
- followed = insert(:user,
%{info: %User.Info{locked: true}}
)
+ followed = insert(:user,
locked: true
)
{:ok, follower} = User.follow(follower, followed)
{:ok, follow_activity} = ActivityPub.follow(follower, followed)
{:ok, follower} = User.follow(follower, followed)
{:ok, follow_activity} = ActivityPub.follow(follower, followed)
@@
-1341,18
+1341,18
@@
defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
assert "http://localhost:4001/users/rye@niu.moe/followers" in activity.recipients
user = User.get_cached_by_id(user.id)
assert "http://localhost:4001/users/rye@niu.moe/followers" in activity.recipients
user = User.get_cached_by_id(user.id)
- assert user.
info.
note_count == 1
+ assert user.note_count == 1
{:ok, user} = Transmogrifier.upgrade_user_from_ap_id("https://niu.moe/users/rye")
ObanHelpers.perform_all()
{:ok, user} = Transmogrifier.upgrade_user_from_ap_id("https://niu.moe/users/rye")
ObanHelpers.perform_all()
- assert user.
info.
ap_enabled
- assert user.
info.
note_count == 1
+ assert user.ap_enabled
+ assert user.note_count == 1
assert user.follower_address == "https://niu.moe/users/rye/followers"
assert user.following_address == "https://niu.moe/users/rye/following"
user = User.get_cached_by_id(user.id)
assert user.follower_address == "https://niu.moe/users/rye/followers"
assert user.following_address == "https://niu.moe/users/rye/following"
user = User.get_cached_by_id(user.id)
- assert user.
info.
note_count == 1
+ assert user.note_count == 1
activity = Activity.get_by_id(activity.id)
assert user.follower_address in activity.recipients
activity = Activity.get_by_id(activity.id)
assert user.follower_address in activity.recipients
@@
-1373,7
+1373,7
@@
defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
"https://cdn.niu.moe/accounts/headers/000/033/323/original/850b3448fa5fd477.png"
}
]
"https://cdn.niu.moe/accounts/headers/000/033/323/original/850b3448fa5fd477.png"
}
]
- } = user.
info.
banner
+ } = user.banner
refute "..." in activity.recipients
refute "..." in activity.recipients