projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add include for the "Further reading" section
[akkoma]
/
test
/
conversation_test.exs
diff --git
a/test/conversation_test.exs
b/test/conversation_test.exs
index 4e36494f80b23edf7123956b85c9b52d952505c8..359aa68403a413fc2488227c84d938c71b712e2f 100644
(file)
--- a/
test/conversation_test.exs
+++ b/
test/conversation_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.ConversationTest do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.ConversationTest do
@@
-11,16
+11,16
@@
defmodule Pleroma.ConversationTest do
import Pleroma.Factory
import Pleroma.Factory
- clear_config_all([:instance, :federating]) do
- Pleroma.Config.put([:instance, :federating], true)
- end
+ setup_all do: clear_config([:instance, :federating], true)
test "it goes through old direct conversations" do
user = insert(:user)
other_user = insert(:user)
{:ok, _activity} =
test "it goes through old direct conversations" do
user = insert(:user)
other_user = insert(:user)
{:ok, _activity} =
- CommonAPI.post(user, %{"visibility" => "direct", "status" => "hey @#{other_user.nickname}"})
+ CommonAPI.post(user, %{visibility: "direct", status: "hey @#{other_user.nickname}"})
+
+ Pleroma.Tests.ObanHelpers.perform_all()
Repo.delete_all(Conversation)
Repo.delete_all(Conversation.Participation)
Repo.delete_all(Conversation)
Repo.delete_all(Conversation.Participation)
@@
-46,7
+46,7
@@
defmodule Pleroma.ConversationTest do
test "public posts don't create conversations" do
user = insert(:user)
test "public posts don't create conversations" do
user = insert(:user)
- {:ok, activity} = CommonAPI.post(user, %{
"status" =>
"Hey"})
+ {:ok, activity} = CommonAPI.post(user, %{
status:
"Hey"})
object = Pleroma.Object.normalize(activity)
context = object.data["context"]
object = Pleroma.Object.normalize(activity)
context = object.data["context"]
@@
-62,7
+62,7
@@
defmodule Pleroma.ConversationTest do
tridi = insert(:user)
{:ok, activity} =
tridi = insert(:user)
{:ok, activity} =
- CommonAPI.post(har, %{
"status" => "Hey @#{jafnhar.nickname}", "visibility" =>
"direct"})
+ CommonAPI.post(har, %{
status: "Hey @#{jafnhar.nickname}", visibility:
"direct"})
object = Pleroma.Object.normalize(activity)
context = object.data["context"]
object = Pleroma.Object.normalize(activity)
context = object.data["context"]
@@
-81,9
+81,9
@@
defmodule Pleroma.ConversationTest do
{:ok, activity} =
CommonAPI.post(jafnhar, %{
{:ok, activity} =
CommonAPI.post(jafnhar, %{
-
"status" =>
"Hey @#{har.nickname}",
-
"visibility" =>
"direct",
-
"in_reply_to_status_id" =>
activity.id
+
status:
"Hey @#{har.nickname}",
+
visibility:
"direct",
+
in_reply_to_status_id:
activity.id
})
object = Pleroma.Object.normalize(activity)
})
object = Pleroma.Object.normalize(activity)
@@
-105,9
+105,9
@@
defmodule Pleroma.ConversationTest do
{:ok, activity} =
CommonAPI.post(tridi, %{
{:ok, activity} =
CommonAPI.post(tridi, %{
-
"status" =>
"Hey @#{har.nickname}",
-
"visibility" =>
"direct",
-
"in_reply_to_status_id" =>
activity.id
+
status:
"Hey @#{har.nickname}",
+
visibility:
"direct",
+
in_reply_to_status_id:
activity.id
})
object = Pleroma.Object.normalize(activity)
})
object = Pleroma.Object.normalize(activity)
@@
-149,14
+149,14
@@
defmodule Pleroma.ConversationTest do
jafnhar = insert(:user, local: false)
{:ok, activity} =
jafnhar = insert(:user, local: false)
{:ok, activity} =
- CommonAPI.post(har, %{
"status" => "Hey @#{jafnhar.nickname}", "visibility" =>
"direct"})
+ CommonAPI.post(har, %{
status: "Hey @#{jafnhar.nickname}", visibility:
"direct"})
{:ok, conversation} = Conversation.create_or_bump_for(activity)
assert length(conversation.participations) == 2
{:ok, activity} =
{:ok, conversation} = Conversation.create_or_bump_for(activity)
assert length(conversation.participations) == 2
{:ok, activity} =
- CommonAPI.post(har, %{
"status" => "Hey @#{jafnhar.nickname}", "visibility" =>
"public"})
+ CommonAPI.post(har, %{
status: "Hey @#{jafnhar.nickname}", visibility:
"public"})
assert {:error, _} = Conversation.create_or_bump_for(activity)
end
assert {:error, _} = Conversation.create_or_bump_for(activity)
end